Versions in this module Expand all Collapse all v1 v1.5.1 May 19, 2026 v1.5.0 May 19, 2026 v1.4.1 May 18, 2026 v1.4.0 May 17, 2026 v1.3.1 May 15, 2026 Changes in this version + var ErrInvalidPassword = errors.New("invalid password") + var ErrNoteNotEncrypted = errors.New("note is not encrypted") + var ErrNoteNotFound = errors.New("note not found") + func CloseDB() error + func InitDB(path string) error + func ListTags() ([]string, error) + func PermanentDeleteNoteByID(ID int64) error + func RestoreNoteByID(ID int64) error + func SoftDeleteNoteByID(ID int64) error + type Encryptor interface + Decrypt func(salt, nonce, ciphertext []byte) ([]byte, error) + Encrypt func(plaintext []byte) (salt, nonce, ciphertext []byte, err error) + type Handler struct + func NewHandler(uploadsDir string) *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 struct + EncryptedOnly bool + Order string + Page int + PageSize int + Query string + Sort string + Tag string + type ListResult struct + HasNext bool + HasPrev bool + NextPage int + Notes []Note + Page int + PageSize int + PrevPage int + Total int + TotalPages int + func ListNotes(p ListParams) (ListResult, error) + type Note struct + Content string + CreatedAt time.Time + DeletedAt *time.Time + ID int64 + ImageData string + IsEncrypted bool + IsPinned bool + Tags []string + Title string + UpdatedAt time.Time + func AddNote(title, content, imageData, tags string) (Note, error) + func AddPrivateNote(title, content, imageData, password string) (Note, error) + func DecryptNoteByID(ID int64, password string) (Note, error) + func GetNoteByID(ID int64) (Note, error) + func ListArchivedNotes() ([]Note, error) + func TogglePinNoteByID(ID int64) (Note, error) + func UpdateNoteByID(ID int64, title, content, imageData string) (Note, error) + func UpdatePrivateNoteByID(ID int64, title, content, imageData, currentPassword, newPassword string) (Note, error) + type PasswordEncryptor struct + func NewPasswordEncryptor(password string) *PasswordEncryptor + func (p *PasswordEncryptor) Decrypt(salt, nonce, ciphertext []byte) ([]byte, error) + func (p *PasswordEncryptor) Encrypt(plaintext []byte) (salt, nonce, ciphertext []byte, err error)