Documentation
¶
Overview ¶
Package config implements lore's minimal config file, decided in https://github.com/cheetahbyte/lore/issues/3: only embeddings provider settings and per-crawled-source options live here, everything else is pure CLI args.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigPath ¶
ConfigPath returns $XDG_CONFIG_HOME/lore/config.toml, falling back to ~/.config/lore/config.toml, per issue #3.
func DataPath ¶
DataPath returns $XDG_DATA_HOME/lore/index.db, falling back to ~/.local/share/lore/index.db, per issue #3.
func EnsureParentDir ¶
EnsureParentDir creates the parent directory of path if it doesn't exist.
Types ¶
type Config ¶
type Config struct {
Embeddings Embeddings `toml:"embeddings"`
Sources map[string]SourceConfig `toml:"sources"`
}
func Load ¶
Load reads and parses the config file at path. A missing file is not an error — it returns a zero-value Config, since every field has a sensible empty default (embeddings disabled, no per-source overrides).
func (*Config) EffectiveAPIKey ¶
EffectiveAPIKey returns the embeddings API key, letting LORE_EMBEDDINGS_API_KEY override whatever's in the config file.
type Embeddings ¶
type Embeddings struct {
Provider string `toml:"provider"` // "" | "openai" | "ollama"
APIKey string `toml:"api_key"` // LORE_EMBEDDINGS_API_KEY env var overrides this
Endpoint string `toml:"endpoint"` // e.g. http://localhost:11434 for ollama
}
Embeddings configures the optional vector-search path decided in issue #7. Provider == "" means vector search is disabled and lore stays FTS-only.
type SourceConfig ¶
type SourceConfig struct {
Depth int `toml:"depth"`
Include []string `toml:"include"`
Exclude []string `toml:"exclude"`
}
SourceConfig holds per-source crawl options, keyed by the source's identity string (e.g. "url:https://docs.example.com"). Only meaningful for url: (crawled) sources, per issue #3.