all repos

onasty @ 86dba8ea0dc14c9a08dbb0baa9b0441168638328

a one-time notes service

onasty/internal/dtos/note.go (view raw)

Smirnov Oleksandr Smirnov Oleksandr
ss2316544@gmail.com
feat(api): get note metadata (#148)..., 11 months ago
1
package dtos
2
3
import (
4
	"time"
5
6
	"github.com/gofrs/uuid/v5"
7
)
8
9
type NoteSlug = string
10
11
type GetNote struct {
12
	Content   string
13
	ReadAt    time.Time
14
	CreatedAt time.Time
15
	ExpiresAt time.Time
16
}
17
18
type NoteMetadata struct {
19
	HasPassword bool
20
	CreatedAt   time.Time
21
}
22
23
type CreateNote struct {
24
	Content              string
25
	UserID               uuid.UUID
26
	Slug                 NoteSlug
27
	BurnBeforeExpiration bool
28
	Password             string
29
	CreatedAt            time.Time
30
	ExpiresAt            time.Time
31
}
32
33
type NoteDetailed struct {
34
	Content              string
35
	Slug                 NoteSlug
36
	BurnBeforeExpiration bool
37
	HasPassword          bool
38
	CreatedAt            time.Time
39
	ExpiresAt            time.Time
40
	ReadAt               time.Time
41
}
42
43
type PatchNote struct {
44
	ExpiresAt            *time.Time
45
	BurnBeforeExpiration *bool
46
}