Documentation
¶
Index ¶
- Variables
- func ConfiguredDirectories(cfg *config.Config) []string
- type Options
- type Progress
- type ProgressFunc
- type ScanResult
- type Scanner
- func (s *Scanner) ScanDirectories(dirs []string) (*ScanResult, error)
- func (s *Scanner) ScanDirectoriesWithOptions(ctx context.Context, dirs []string, opts Options) (*ScanResult, error)
- func (s *Scanner) ScanWithContext(ctx context.Context, dirs []string, opts Options) (*ScanResult, error)
- func (s *Scanner) ScanWithProgress(dirs []string, progressFn func(path string, found int)) (*ScanResult, error)
- func (s *Scanner) ScanWithProgressDetail(dirs []string, opts Options) (*ScanResult, error)
Constants ¶
This section is empty.
Variables ¶
var ModelFileExtensions = []string{
".gguf",
".ggml",
".safetensors",
".ckpt",
".pt",
".pth",
".bin",
".h5",
".pb",
".onnx",
}
ModelFileExtensions are file extensions we recognize as model files
Functions ¶
func ConfiguredDirectories ¶ added in v0.7.0
ConfiguredDirectories returns the library scan roots implied by config.
Types ¶
type Options ¶ added in v0.7.0
type Options struct {
Workers int
Progress ProgressFunc
RepairStale bool
}
Options controls scanner behavior.
type Progress ¶ added in v0.7.0
type Progress struct {
Phase string
Path string
FilesScanned int
ModelsFound int
ModelsAdded int
ModelsSkipped int
StaleChecked int
StaleRemoved int
Errors int
}
Progress describes the latest scanner state for CLI and TUI callers.
type ProgressFunc ¶ added in v0.7.0
type ProgressFunc func(Progress)
ProgressFunc receives progress snapshots during a scan.
type ScanResult ¶
type ScanResult struct {
FilesScanned int
ModelsFound int
ModelsAdded int
ModelsSkipped int
StaleChecked int
StaleRemoved int
Errors []error
}
ScanResult contains information about a scan operation
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner scans directories for model files and populates metadata
func (*Scanner) ScanDirectories ¶
func (s *Scanner) ScanDirectories(dirs []string) (*ScanResult, error)
ScanDirectories scans multiple directories for model files
func (*Scanner) ScanDirectoriesWithOptions ¶ added in v0.7.0
func (s *Scanner) ScanDirectoriesWithOptions(ctx context.Context, dirs []string, opts Options) (*ScanResult, error)
ScanDirectoriesWithOptions scans multiple directories with bounded worker concurrency while keeping database operations serialized.
func (*Scanner) ScanWithContext ¶ added in v0.7.0
func (s *Scanner) ScanWithContext(ctx context.Context, dirs []string, opts Options) (*ScanResult, error)
ScanWithContext scans directories with cancellation support.
func (*Scanner) ScanWithProgress ¶
func (s *Scanner) ScanWithProgress(dirs []string, progressFn func(path string, found int)) (*ScanResult, error)
ScanWithProgress scans directories and calls progress callback
func (*Scanner) ScanWithProgressDetail ¶ added in v0.7.0
func (s *Scanner) ScanWithProgressDetail(dirs []string, opts Options) (*ScanResult, error)
ScanWithProgressDetail scans directories and reports detailed progress.