Documentation
¶
Overview ¶
Package config implements load/save of Coggo's TOML configuration file.
The config file is optional: Load returns Default() when the file is missing. Defaults are filled in for any zero-valued fields after parse, so partial config files behave the same as empty ones for the unset fields.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
func DefaultPath() string
DefaultPath returns the preferred config-file location. XDG-compliant (~/.config/coggo/config.toml) with a ~/.coggo/config.toml fallback if XDG can't be resolved.
func ExpandPath ¶
ExpandPath expands a leading "~" in p to the current user's home directory.
func ResolvedDBPath ¶
ResolvedDBPath returns the SQLite database path inside the data dir.
Types ¶
type Config ¶
type Config struct {
Server ServerConfig `toml:"server"`
Storage StorageConfig `toml:"storage"`
Embedding EmbeddingConfig `toml:"embedding"`
Tailscale TailscaleConfig `toml:"tailscale"`
Logging LoggingConfig `toml:"logging"`
}
Config is the on-disk configuration. See spec §9.2.
type EmbeddingConfig ¶
EmbeddingConfig holds the embedding provider settings. The API key is sourced from the COGGO_EMBEDDING_API_KEY environment variable, never the config file.
type LoggingConfig ¶
type LoggingConfig struct {
Level string `toml:"level"`
}
LoggingConfig holds the slog level.
type ServerConfig ¶
type ServerConfig struct {
ListenAddress string `toml:"listen_address"`
DataDir string `toml:"data_dir"`
}
ServerConfig holds the listen address and data directory.
type StorageConfig ¶
type StorageConfig struct {
Backend string `toml:"backend"`
EmbeddingDimension int `toml:"embedding_dimension"`
}
StorageConfig holds the storage backend selection and embedding dimension.
type TailscaleConfig ¶
type TailscaleConfig struct {
Enabled bool `toml:"enabled"`
FunnelEnabled bool `toml:"funnel_enabled"`
}
TailscaleConfig holds the Tailscale integration toggles.