Documentation
¶
Overview ¶
Package index owns the rebuildable SQLite cache and all SQL access.
Index ¶
- Variables
- func CachePath(root string) (string, error)
- func Error(err error) error
- func IsUnreadable(err error) bool
- type Backlink
- type Broken
- type BrokenLink
- type EmbedNote
- type EmbeddingCounts
- type Incoming
- type Index
- func (i *Index) Backlinks(ctx context.Context, id string) (Incoming, error)
- func (i *Index) Broken(ctx context.Context) (Broken, error)
- func (i *Index) Close() error
- func (i *Index) Count(ctx context.Context) (int, error)
- func (i *Index) EmbedNotes(ctx context.Context, model string) ([]EmbedNote, error)
- func (i *Index) EmbeddingCounts(ctx context.Context, model string) (EmbeddingCounts, error)
- func (i *Index) Keyword(ctx context.Context, query string, limit int) ([]Match, error)
- func (i *Index) LinkCounts(ctx context.Context) (links, broken, orphans int, err error)
- func (i *Index) Links(ctx context.Context, id string) (Outgoing, error)
- func (i *Index) List(ctx context.Context, tag string, limit int) (Listing, error)
- func (i *Index) Orphans(ctx context.Context) (Orphans, error)
- func (i *Index) StoreEmbeddings(ctx context.Context, n EmbedNote, model string, vectors [][]float32) error
- func (i *Index) Sync(ctx context.Context, root string, full bool) error
- func (i *Index) SyncNote(ctx context.Context, root, id string) error
- func (i *Index) Tags(ctx context.Context) ([]Tag, error)
- func (i *Index) Vectors(ctx context.Context, model string) ([]Vector, error)
- type Link
- type Listing
- type Match
- type Orphan
- type Orphans
- type Outgoing
- type Summary
- type Tag
- type Vector
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIndex = errors.New("index error")
Functions ¶
func IsUnreadable ¶
IsUnreadable distinguishes open/schema failures from ordinary query errors.
Types ¶
type Broken ¶
type Broken struct {
Broken []BrokenLink `json:"broken" jsonschema:"broken"`
Total int `json:"total" jsonschema:"total"`
Truncated bool `json:"truncated" jsonschema:"truncated"`
}
type BrokenLink ¶
type EmbeddingCounts ¶
type Index ¶
type Index struct {
Path string
// contains filtered or unexported fields
}
func OpenForReindex ¶
OpenForReindex discards an unreadable cache and all SQLite sidecars before retrying.
func (*Index) EmbedNotes ¶
func (*Index) EmbeddingCounts ¶
func (*Index) LinkCounts ¶
LinkCounts returns the graph totals, independently of report caps.
func (*Index) StoreEmbeddings ¶
func (i *Index) StoreEmbeddings(ctx context.Context, n EmbedNote, model string, vectors [][]float32) error
StoreEmbeddings publishes a complete note only if its indexed stamp still matches.
type Link ¶
type Link struct {
Target string `json:"target" jsonschema:"target"`
TargetID *string `json:"target_id" jsonschema:"target id"`
Heading string `json:"heading" jsonschema:"heading"`
Alias string `json:"alias" jsonschema:"alias"`
Embed bool `json:"embed" jsonschema:"embed"`
Line int `json:"line" jsonschema:"line"`
Resolved bool `json:"resolved" jsonschema:"resolved"`
}
Click to show internal directories.
Click to hide internal directories.