indexing

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileWatcher

type FileWatcher struct {
	// contains filtered or unexported fields
}

FileWatcher 文件监控器

func NewFileWatcher

func NewFileWatcher(indexer Indexer, logger logging.Logger) (*FileWatcher, error)

NewFileWatcher 创建文件监控器

func (*FileWatcher) AddConfigs

func (fw *FileWatcher) AddConfigs(configs ...WatchConfig)

AddConfigs 添加多个监控配置

func (*FileWatcher) Start

func (fw *FileWatcher) Start() error

Start 启动文件监控(阻塞式)

func (*FileWatcher) Stop

func (fw *FileWatcher) Stop() error

Stop 停止文件监控

type Indexer

type Indexer interface {
	// IndexFile processes a single file into the Vector/Graph stores.
	IndexFile(ctx context.Context, filePath string) (*core.IndexingContext, error)

	// IndexDirectory concurrently processes an entire directory.
	IndexDirectory(ctx context.Context, dirPath string, recursive bool) error
}

Indexer defines the entry point for the offline data preparation pipeline.

type WatchConfig

type WatchConfig struct {
	Path             string        // 监控目录
	Recursive        bool          // 是否递归监控子目录
	Patterns         []string      // 文件匹配模式(例如:[]string{"*.pdf", "*.md"})
	Exclude          []string      // 排除的文件模式
	DebounceInterval time.Duration // 防抖间隔,默认 500ms
}

WatchConfig 文件监控配置

Jump to

Keyboard shortcuts

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