Documentation
¶
Overview ¶
Package notes is the public Go API for td notes.
Sidecar and other in-process clients should open a Store and call these methods instead of speaking SQL against .todos/issues.db. Writes go through internal/db (withWriteLock + action_log), the same path as `td note`.
Index ¶
- type ListOptions
- type Note
- type Store
- func (s *Store) Archive(id string) error
- func (s *Store) Close() error
- func (s *Store) Create(title, content string) (*Note, error)
- func (s *Store) Delete(id string) error
- func (s *Store) Get(id string) (*Note, error)
- func (s *Store) GetAny(id string) (*Note, error)
- func (s *Store) List(opts ListOptions) ([]Note, error)
- func (s *Store) Pin(id string) error
- func (s *Store) Restore(id string) (*Note, error)
- func (s *Store) Unarchive(id string) error
- func (s *Store) Unpin(id string) error
- func (s *Store) Update(id, title, content string) (*Note, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListOptions ¶
ListOptions filters List. Limit <= 0 means unlimited.
type Note ¶
type Note struct {
ID string `json:"id"`
Title string `json:"title"`
Content string `json:"content"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Pinned bool `json:"pinned"`
Archived bool `json:"archived"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
Note is a freeform note stored in the project issues.db.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a long-lived handle on a project's notes.
func Init ¶
Init creates a new td database at baseDir and returns a notes Store. Production Sidecar should call Open; Init is for tests and first-run setups.
func (*Store) List ¶
func (s *Store) List(opts ListOptions) ([]Note, error)
List returns notes matching opts. Limit <= 0 means unlimited.