fts

package
v0.0.66 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2026 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuiltInDocPrefix = "bi/"
)

Every built-in document ID is prefixed with this constant so that existing path-parsing code can still split bundleDir / fileName.

Variables

This section is empty.

Functions

func InitToolFTSListeners

func InitToolFTSListeners(
	baseDir string,
	builtInLister ToolBuiltInLister,
) (*ftsengine.Engine, error)

InitToolFTSListeners initialises the tools FTS database and starts background rebuild jobs.

func NewUserToolsFTSListener

func NewUserToolsFTSListener(e *ftsengine.Engine) mapstore.FileListener

NewUserToolsFTSListener returns a mapstore.FileListener that updates the FTS engine on file changes.

func ReindexOneBuiltInTool

func ReindexOneBuiltInTool(
	ctx context.Context,
	bundleID bundleitemutils.BundleID,
	bundleSlug bundleitemutils.BundleSlug,
	tool spec.Tool,
	engine *ftsengine.Engine,
) error

ReindexOneBuiltInTool updates exactly one built-in tool.

func StartBuiltInToolsFTSRebuild

func StartBuiltInToolsFTSRebuild(
	ctx context.Context,
	lister ToolBuiltInLister,
	engine *ftsengine.Engine,
)

StartBuiltInToolsFTSRebuild spawns a goroutine that synchronises the built-in tools with the FTS index.

func StartUserToolsFTSRebuild

func StartUserToolsFTSRebuild(ctx context.Context, baseDir string, e *ftsengine.Engine)

StartUserToolsFTSRebuild launches a goroutine to rebuild the FTS index for all tool specs under baseDir.

Types

type ToolBuiltInLister

type ToolBuiltInLister func(ctx context.Context) (
	bundles map[bundleitemutils.BundleID]spec.ToolBundle,
	tools map[bundleitemutils.BundleID]map[bundleitemutils.ItemID]spec.Tool,
	err error,
)

ToolBuiltInLister returns the current snapshot of all built-in bundles and tools. Overlay should already be applied, so that enabled flags are correct.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL