Documentation
¶
Overview ¶
Package config loads Excise's optional excise.toml file.
Discovery order (first hit wins):
- ./excise.toml (project-local)
- $XDG_CONFIG_HOME/excise/excise.toml (XDG explicit)
- ~/.config/excise/excise.toml (XDG default)
A missing file is NOT an error — Load returns a Config populated entirely from defaults. The [llm] section governs v0.3's opt-in Ollama rerank; the table is optional, individual fields are optional, and any field omitted from the file inherits its default. This keeps the binary usable with no configuration at all.
Index ¶
Constants ¶
const ( DefaultLLMHost = "http://localhost:11434" DefaultLLMModel = "llama3.2" DefaultLLMTopN = 5 DefaultLLMTimeoutSec = 20 )
Defaults — kept package-level so tests and the CLI can reference them directly, and so the README "what are the defaults" question has one place to point at.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
LLM LLM `toml:"llm"`
// SourcePath records where the config was loaded from (empty if no file
// was found and defaults are in use). Useful for debug output.
SourcePath string `toml:"-"`
}
Config mirrors the top-level structure of excise.toml. Additional sections can be added without breaking older configs — unknown keys are ignored.
func Load ¶
Load discovers excise.toml on the standard search path, parses it, and fills missing fields with defaults. If no file is found, the defaults are returned with SourcePath="".
Validation: the host must parse as an absolute URL. TopN<=0 and TimeoutSec<=0 are coerced back to defaults rather than erroring — a typo shouldn't hard-block a mid-session run.