Documentation
¶
Index ¶
- Variables
- type Note
- type NoteStore
- func (s *NoteStore) AddSyncHistory(entry *SyncHistoryEntry) error
- func (s *NoteStore) Close() error
- func (s *NoteStore) CreateNote(note *Note) error
- func (s *NoteStore) DeleteNote(id string) error
- func (s *NoteStore) DeleteSyncState(noteID, backend string) error
- func (s *NoteStore) DequeueSyncJob() (*SyncQueueItem, error)
- func (s *NoteStore) EnqueueSyncJob(noteID string, backends []string, direction string, attempts int) error
- func (s *NoteStore) FindNoteByFilename(filename string) (*Note, error)
- func (s *NoteStore) GetNote(id string) (*Note, error)
- func (s *NoteStore) GetSyncState(noteID, backend string) (*SyncState, error)
- func (s *NoteStore) GetVersion(noteID string, versionNum int) (*Version, error)
- func (s *NoteStore) Init() error
- func (s *NoteStore) ListNotes() ([]*Note, error)
- func (s *NoteStore) ListNotesByTag(tag string) ([]*Note, error)
- func (s *NoteStore) ListRecentSyncHistory(limit int) ([]*SyncHistoryEntry, error)
- func (s *NoteStore) ListSyncHistory(noteID string) ([]*SyncHistoryEntry, error)
- func (s *NoteStore) ListSyncStates() ([]*SyncState, error)
- func (s *NoteStore) ListSyncStatesByStatus(status string) ([]*SyncState, error)
- func (s *NoteStore) ListVersions(noteID string) ([]*Version, error)
- func (s *NoteStore) QueueLength() (int, error)
- func (s *NoteStore) SaveVersion(noteID string, content string, trigger string) (*Version, error)
- func (s *NoteStore) SearchNotes(query string) ([]*Note, error)
- func (s *NoteStore) UpdateNote(note *Note) error
- func (s *NoteStore) UpsertSyncState(state *SyncState) error
- type Store
- type SyncHistoryEntry
- type SyncQueueItem
- type SyncState
- type Version
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Note ¶
type Note struct {
ID string `json:"id"`
Filename string `json:"filename"`
Title string `json:"title"`
Path string `json:"path"`
Folder string `json:"folder"`
ContentHash string `json:"content_hash"`
WordCount int `json:"word_count"`
CreatedAt time.Time `json:"created_at"`
ModifiedAt time.Time `json:"modified_at"`
Archived bool `json:"archived"`
Pinned bool `json:"pinned"`
Content string `json:"-"` // full text for FTS indexing (not stored in notes table)
Tags []string `json:"tags"`
}
type NoteStore ¶
type NoteStore struct {
// contains filtered or unexported fields
}
func NewNoteStore ¶
func (*NoteStore) AddSyncHistory ¶
func (s *NoteStore) AddSyncHistory(entry *SyncHistoryEntry) error
func (*NoteStore) CreateNote ¶
func (*NoteStore) DeleteNote ¶
func (*NoteStore) DeleteSyncState ¶
func (*NoteStore) DequeueSyncJob ¶
func (s *NoteStore) DequeueSyncJob() (*SyncQueueItem, error)
func (*NoteStore) EnqueueSyncJob ¶
func (*NoteStore) FindNoteByFilename ¶
func (*NoteStore) GetSyncState ¶
func (*NoteStore) GetVersion ¶
func (*NoteStore) ListRecentSyncHistory ¶
func (s *NoteStore) ListRecentSyncHistory(limit int) ([]*SyncHistoryEntry, error)
func (*NoteStore) ListSyncHistory ¶
func (s *NoteStore) ListSyncHistory(noteID string) ([]*SyncHistoryEntry, error)
func (*NoteStore) ListSyncStates ¶
func (*NoteStore) ListSyncStatesByStatus ¶
func (*NoteStore) ListVersions ¶
func (*NoteStore) QueueLength ¶
func (*NoteStore) SaveVersion ¶
func (*NoteStore) UpdateNote ¶
func (*NoteStore) UpsertSyncState ¶
type Store ¶
type Store interface {
Init() error
CreateNote(note *Note) error
GetNote(id string) (*Note, error)
FindNoteByFilename(filename string) (*Note, error)
UpdateNote(note *Note) error
DeleteNote(id string) error
ListNotes() ([]*Note, error)
ListNotesByTag(tag string) ([]*Note, error)
SearchNotes(query string) ([]*Note, error)
Close() error
GetSyncState(noteID, backend string) (*SyncState, error)
UpsertSyncState(state *SyncState) error
DeleteSyncState(noteID, backend string) error
ListSyncStates() ([]*SyncState, error)
ListSyncStatesByStatus(status string) ([]*SyncState, error)
EnqueueSyncJob(noteID string, backends []string, direction string, attempts int) error
DequeueSyncJob() (*SyncQueueItem, error)
QueueLength() (int, error)
AddSyncHistory(entry *SyncHistoryEntry) error
ListSyncHistory(noteID string) ([]*SyncHistoryEntry, error)
SaveVersion(noteID string, content string, trigger string) (*Version, error)
ListVersions(noteID string) ([]*Version, error)
GetVersion(noteID string, versionNum int) (*Version, error)
}
type SyncHistoryEntry ¶
type SyncQueueItem ¶
type SyncState ¶
type SyncState struct {
NoteID string `json:"note_id"`
Backend string `json:"backend"`
RemoteID string `json:"remote_id,omitempty"`
LastSyncAt time.Time `json:"last_sync_at,omitempty"`
LastHash string `json:"last_hash,omitempty"`
Status string `json:"status"`
ErrorMsg string `json:"error_msg,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.