Documentation
¶
Overview ¶
Package searchcache is Harbor's SQLite FTS5-backed tool search index. FTS5 search over each tool's name, description and tags plus the providing server's display title and description, ranked by bm25, with a substring fallback. The index is process-wide: every Search carries the caller's visibility predicate, applied BEFORE the limit, so one principal's rows can neither be returned to another nor crowd its results out.
The index is a mirror of the in-memory catalog (the catalog is its only writer and reconciles it on every change), so it is emptied at open and never outlives the process's own registrations.
The driver self-registers under "searchcache" from its init(). The production binary picks it up via blank import in cmd/harbor/main.go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
DSN string
}
Config carries the SearchCache driver configuration.
type SearchCache ¶
type SearchCache interface {
Search(ctx context.Context, req tools.ToolSearchRequest) ([]tools.Tool, error)
Sync(ctx context.Context, tools []tools.Tool) error
Remove(ctx context.Context, names []string) error
Close() error
}
SearchCache is the tool search index. Production callers reach this through the tools.Catalog and never construct a driver directly.
func New ¶
func New(cfg Config) (SearchCache, error)
New constructs a SQLite-backed SearchCache against cfg.DSN.