Documentation
¶
Index ¶
- Constants
- func Format(result *Result) string
- func FormatBatch(result *Result, requested, missing []string) string
- func FormatCompact(result *Result) string
- func FormatDiffs(diffs []*store.DiffRecord) string
- func FormatRelated(related []*store.RelatedNode, budget int) string
- type Engine
- func (e *Engine) Delta(ctx context.Context, sinceSnapshot int64) ([]*store.DiffRecord, error)
- func (e *Engine) Diff(ctx context.Context, fromSnapshot, toSnapshot int64) ([]*store.DiffRecord, error)
- func (e *Engine) Fetch(ctx context.Context, anchor string, budget, depth int) (*Result, error)
- func (e *Engine) FetchBatch(ctx context.Context, ids []string, budget int) (*Result, []string, error)
- func (e *Engine) Search(ctx context.Context, query string, budget int) (*Result, error)
- type QueryStore
- type Result
- type ScoredNode
Constants ¶
View Source
const ( DefaultMaxDepth = 32 MaxDepthCap = treewalk.MaxDepth )
Variables ¶
This section is empty.
Functions ¶
func FormatBatch ¶ added in v0.3.0
func FormatCompact ¶
func FormatDiffs ¶ added in v0.3.1
func FormatDiffs(diffs []*store.DiffRecord) string
func FormatRelated ¶ added in v0.3.0
func FormatRelated(related []*store.RelatedNode, budget int) string
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewEngine ¶
func NewEngine(s QueryStore) *Engine
func (*Engine) FetchBatch ¶ added in v0.3.0
type QueryStore ¶
type QueryStore interface {
GetNode(ctx context.Context, id string) (*store.Node, error)
GetNodesByIDs(ctx context.Context, ids []string) ([]*store.Node, error)
GetAncestors(ctx context.Context, id string) ([]*store.Node, error)
GetDescendants(ctx context.Context, id string, maxDepth int) ([]*store.Node, error)
GetSiblings(ctx context.Context, id string) ([]*store.Node, error)
SearchRanked(ctx context.Context, query string, limit int) ([]*store.RankedNode, error)
GetDiffsSince(ctx context.Context, sinceSnapshotID int64) ([]*store.DiffRecord, error)
GetDiffsBetween(ctx context.Context, fromSnapshotID, toSnapshotID int64) ([]*store.DiffRecord, error)
}
type Result ¶
type Result struct {
Nodes []ScoredNode
TokensUsed int
}
type ScoredNode ¶
Click to show internal directories.
Click to hide internal directories.