all repos

onasty @ 86dba8e

a one-time notes service

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package dtos

import (
	"time"

	"github.com/gofrs/uuid/v5"
)

type NoteSlug = string

type GetNote struct {
	Content   string
	ReadAt    time.Time
	CreatedAt time.Time
	ExpiresAt time.Time
}

type NoteMetadata struct {
	HasPassword bool
	CreatedAt   time.Time
}

type CreateNote struct {
	Content              string
	UserID               uuid.UUID
	Slug                 NoteSlug
	BurnBeforeExpiration bool
	Password             string
	CreatedAt            time.Time
	ExpiresAt            time.Time
}

type NoteDetailed struct {
	Content              string
	Slug                 NoteSlug
	BurnBeforeExpiration bool
	HasPassword          bool
	CreatedAt            time.Time
	ExpiresAt            time.Time
	ReadAt               time.Time
}

type PatchNote struct {
	ExpiresAt            *time.Time
	BurnBeforeExpiration *bool
}