Documentation
¶
Overview ¶
Package backend defines the Backend interface for note storage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
Write(n *note.Note) error
Read(id string) (*note.Note, error)
Delete(id string) error
List() ([]*note.Note, error)
AddLink(fromID, toID, annotation, linkType string) error
AddLinks(fromID string, targets []LinkTarget) error
RemoveLink(fromID, toID string) error
Promote(id string, to note.Status) error
Update(n *note.Note) error
UpdateLink(fromID, toID string, annotation, linkType *string) error
BulkUpdateLinks(fromID string, updates []LinkUpdate) error
BulkWrite(notes []*note.Note) error
}
Backend abstracts note storage so the CLI can be tested and extended without depending on a specific implementation.
type LinkTarget ¶
LinkTarget is a (toID, annotation, optional type) pair used by AddLinks.
type LinkUpdate ¶
type LinkUpdate struct {
ToID string
Annotation *string // nil = leave unchanged
Type *string // nil = leave unchanged
}
LinkUpdate is a (toID, optional annotation, optional type) used by BulkUpdateLinks.
Click to show internal directories.
Click to hide internal directories.