Versions in this module Expand all Collapse all v0 v0.1.0 Mar 10, 2026 Changes in this version + var ErrConflict = errors.New("conflict: server version is newer") + var ErrNoteNotFound = errors.New("note not found") + type Note struct + CreatedAt time.Time + EncryptedPayload []byte + ID uuid.UUID + UpdatedAt time.Time + UserID uuid.UUID + type NoteCursor struct + AfterNoteID uuid.UUID + AfterUpdatedAt time.Time + type NoteResponse struct + CreatedAt *time.Time + EncryptedPayload string + NoteID uuid.UUID + UpdatedAt *time.Time + type NoteTombstone struct + DeletedAt time.Time + NoteID uuid.UUID + UserID uuid.UUID + type NotesHandler struct + func NewNotesHandler(service service) *NotesHandler + func (h *NotesHandler) Delete(c *echo.Context) error + func (h *NotesHandler) GetAll(c *echo.Context) error + func (h *NotesHandler) GetByID(c *echo.Context) error + func (h *NotesHandler) Upsert(c *echo.Context) error + type NotesListResponse struct + NextCursor *string + Notes []NoteResponse + ServerTime *time.Time + Tombstones []TombstoneResponse + type NotesRepository struct + func NewNotesRepository(db *gorm.DB) *NotesRepository + func (r *NotesRepository) CountLiveNotes(ctx context.Context, userID uuid.UUID) (int64, error) + func (r *NotesRepository) Delete(ctx context.Context, noteID uuid.UUID, userID uuid.UUID) error + func (r *NotesRepository) FindAll(ctx context.Context, userID uuid.UUID) ([]Note, error) + func (r *NotesRepository) FindAllPaginated(ctx context.Context, userID uuid.UUID, limit int, afterUpdatedAt time.Time, ...) ([]Note, error) + func (r *NotesRepository) FindAllTombstones(ctx context.Context, userID uuid.UUID) ([]NoteTombstone, error) + func (r *NotesRepository) FindByID(ctx context.Context, noteID uuid.UUID, userID uuid.UUID) (*Note, error) + func (r *NotesRepository) FindTombstonesSince(ctx context.Context, userID uuid.UUID, since time.Time) ([]NoteTombstone, error) + func (r *NotesRepository) FindUpdatedSince(ctx context.Context, userID uuid.UUID, since time.Time) ([]Note, error) + func (r *NotesRepository) PurgeExpiredTombstones(ctx context.Context, olderThan time.Time) (int64, error) + func (r *NotesRepository) Upsert(ctx context.Context, note *Note) error + type NotesService struct + func NewNotesService(repository repository) *NotesService + func (s *NotesService) DeleteNote(ctx context.Context, noteID uuid.UUID, userID uuid.UUID) error + func (s *NotesService) GetNoteByID(ctx context.Context, noteID uuid.UUID, userID uuid.UUID) (*Note, error) + func (s *NotesService) GetNotesSince(ctx context.Context, userID uuid.UUID, since *time.Time, cursor *NoteCursor, ...) ([]Note, []NoteTombstone, bool, error) + func (s *NotesService) UpsertNote(ctx context.Context, userID uuid.UUID, noteID uuid.UUID, ...) (*Note, error) + type TombstoneResponse struct + DeletedAt *time.Time + NoteID uuid.UUID + type UpsertNoteRequest struct + BaseVersion *time.Time + EncryptedPayload string