Documentation
¶
Index ¶
- Variables
- func CloseDB() error
- func InitDB(database *sql.DB) error
- func ListTags(ctx context.Context) ([]string, error)
- func PermanentDeleteNoteByID(ctx context.Context, ID int64) error
- func RestoreNoteByID(ctx context.Context, ID int64) error
- func SoftDeleteNoteByID(ctx context.Context, ID int64) error
- type Encryptor
- type Handler
- func (h *Handler) CreateNote(c *echo.Context) error
- func (h *Handler) CreatePrivateNote(c *echo.Context) error
- func (h *Handler) DecryptNote(c *echo.Context) error
- func (h *Handler) DeleteNote(c *echo.Context) error
- func (h *Handler) GetNote(c *echo.Context) error
- func (h *Handler) ListArchive(c *echo.Context) error
- func (h *Handler) ListNotes(c *echo.Context) error
- func (h *Handler) PermanentDeleteNote(c *echo.Context) error
- func (h *Handler) RestoreNote(c *echo.Context) error
- func (h *Handler) ShowCreateForm(c *echo.Context) error
- func (h *Handler) ShowEditForm(c *echo.Context) error
- func (h *Handler) ShowPrivateCreateForm(c *echo.Context) error
- func (h *Handler) TogglePinNote(c *echo.Context) error
- func (h *Handler) UnlockPrivateEditForm(c *echo.Context) error
- func (h *Handler) UpdateNote(c *echo.Context) error
- type ListParams
- type ListResult
- type Note
- func AddNote(ctx context.Context, title, content, imageData, tags string) (Note, error)
- func AddPrivateNote(ctx context.Context, title, content, imageData, password string) (Note, error)
- func DecryptNoteByID(ctx context.Context, ID int64, password string) (Note, error)
- func GetNoteByID(ctx context.Context, ID int64) (Note, error)
- func ListArchivedNotes(ctx context.Context) ([]Note, error)
- func TogglePinNoteByID(ctx context.Context, ID int64) (Note, error)
- func UpdateNoteByID(ctx context.Context, ID int64, title, content, imageData string) (Note, error)
- func UpdatePrivateNoteByID(ctx context.Context, ID int64, ...) (Note, error)
- type PasswordEncryptor
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) ShowPrivateCreateForm ¶
func (*Handler) UnlockPrivateEditForm ¶
type ListParams ¶
type ListResult ¶
type ListResult struct {
Notes []Note
Total int
Page int
PageSize int
TotalPages int
HasPrev bool
HasNext bool
PrevPage int
NextPage int
}
func ListNotes ¶
func ListNotes(ctx context.Context, p ListParams) (ListResult, error)
type Note ¶
type Note struct {
ID int64
Title string
Content string
ImageData string
Tags []string
IsPinned bool
IsEncrypted bool
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time
}
func AddPrivateNote ¶
func DecryptNoteByID ¶
func UpdateNoteByID ¶
type PasswordEncryptor ¶
type PasswordEncryptor struct {
// contains filtered or unexported fields
}
func NewPasswordEncryptor ¶
func NewPasswordEncryptor(password string) *PasswordEncryptor
Click to show internal directories.
Click to hide internal directories.