all repos

onasty @ dependabot/go_modules/go_modules-eee72e131a

a one-time notes service

onasty/internal/service/notesrv/input.go (view raw)

Olexandr Smirnov Olexandr Smirnov
ss2316544@gmail.com
refactor: don't pass note password in url (#167)..., 10 months ago
1
package notesrv
2
3
import "github.com/olexsmir/onasty/internal/dtos"
4
5
const EmptyPassword = ""
6
7
// GetNoteBySlugInput used as input for [GetBySlugAndRemoveIfNeeded]
8
type GetNoteBySlugInput struct {
9
	// Slug is a note's slug :) *Required*
10
	Slug dtos.NoteSlug
11
12
	// Password is a note's password.
13
	// Leave it `""` if note has no password.
14
	Password string
15
}
16
17
func (i GetNoteBySlugInput) HasPassword() bool {
18
	return i.Password != EmptyPassword
19
}