Documentation
¶
Index ¶
- Variables
- type Chunk
- type Link
- type LinkKind
- type Note
- type Operation
- type SearchHit
- type Source
- type Store
- func (s *Store) Close() error
- func (s *Store) CreateChunk(ctx context.Context, c *Chunk) error
- func (s *Store) CreateLink(ctx context.Context, l *Link) error
- func (s *Store) CreateNote(ctx context.Context, n *Note) error
- func (s *Store) CreateSource(ctx context.Context, src *Source) error
- func (s *Store) DB() *sql.DB
- func (s *Store) GetChunk(ctx context.Context, id int64) (*Chunk, error)
- func (s *Store) GetNote(ctx context.Context, id int64) (*Note, error)
- func (s *Store) GetNoteBySlug(ctx context.Context, slug string) (*Note, error)
- func (s *Store) GetSource(ctx context.Context, id int64) (*Source, error)
- func (s *Store) GetSourceByHash(ctx context.Context, hash string) (*Source, error)
- func (s *Store) IndexChunk(ctx context.Context, c *Chunk, title string) error
- func (s *Store) IndexNote(ctx context.Context, n *Note) error
- func (s *Store) LinksFromNote(ctx context.Context, noteID int64) ([]*Link, error)
- func (s *Store) LinksToNote(ctx context.Context, noteID int64) ([]*Link, error)
- func (s *Store) ListNotes(ctx context.Context, kind string, limit, offset int) ([]*Note, error)
- func (s *Store) LogOperation(ctx context.Context, op *Operation) error
- func (s *Store) Search(ctx context.Context, query string, limit int) ([]SearchHit, error)
- func (s *Store) UpdateNote(ctx context.Context, n *Note, reason string) error
- func (s *Store) WithTx(ctx context.Context, fn func(*Tx) error) error
- type Tx
- func (t *Tx) CreateChunk(ctx context.Context, c *Chunk) error
- func (t *Tx) CreateLink(ctx context.Context, l *Link) error
- func (t *Tx) CreateNote(ctx context.Context, n *Note) error
- func (t *Tx) CreateSource(ctx context.Context, src *Source) error
- func (t *Tx) GetChunk(ctx context.Context, id int64) (*Chunk, error)
- func (t *Tx) GetNote(ctx context.Context, id int64) (*Note, error)
- func (t *Tx) GetNoteBySlug(ctx context.Context, slug string) (*Note, error)
- func (t *Tx) GetSource(ctx context.Context, id int64) (*Source, error)
- func (t *Tx) GetSourceByHash(ctx context.Context, hash string) (*Source, error)
- func (t *Tx) IndexChunk(ctx context.Context, c *Chunk, title string) error
- func (t *Tx) IndexNote(ctx context.Context, n *Note) error
- func (t *Tx) LinksFromNote(ctx context.Context, noteID int64) ([]*Link, error)
- func (t *Tx) LinksToNote(ctx context.Context, noteID int64) ([]*Link, error)
- func (t *Tx) ListNotes(ctx context.Context, kind string, limit, offset int) ([]*Note, error)
- func (t *Tx) LogOperation(ctx context.Context, op *Operation) error
- func (t *Tx) UpdateNote(ctx context.Context, n *Note, reason string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("storage: not found")
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) GetNoteBySlug ¶
func (*Store) GetSourceByHash ¶
func (*Store) IndexChunk ¶
func (*Store) LinksFromNote ¶
func (*Store) LinksToNote ¶
func (*Store) Search ¶
Search runs a BM25 query. Higher score = more relevant (we return -rank so callers can sort descending).
func (*Store) UpdateNote ¶
UpdateNote runs the archive+update under a dedicated transaction so the two writes stay atomic when called outside of an outer tx.
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx is a transactional handle that exposes the same CRUD surface as Store but batches writes under a single SQLite transaction.
func (*Tx) GetNoteBySlug ¶
func (*Tx) GetSourceByHash ¶
func (*Tx) LinksFromNote ¶
func (*Tx) LinksToNote ¶
Click to show internal directories.
Click to hide internal directories.