Documentation
¶
Index ¶
- func AllSettings() map[string]interface{}
- func BindEnv(key string, envVar string) error
- func GetBool(key string) bool
- func GetDuration(key string) time.Duration
- func GetInt(key string) int
- func GetString(key string) string
- func IsSet(key string) bool
- func WatchConfig(onChange func(*Config)) error
- type CalibrationConfig
- type Config
- type LoggingConfig
- type MCPConfig
- type RedisConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllSettings ¶ added in v0.3.0
func AllSettings() map[string]interface{}
AllSettings returns all configuration settings as a map. Useful for debugging and configuration inspection.
func BindEnv ¶ added in v0.3.0
BindEnv explicitly binds an environment variable to a config key. This is useful for non-standard environment variable names.
func GetDuration ¶ added in v0.3.0
GetDuration retrieves a duration value from configuration by key.
func GetString ¶ added in v0.3.0
GetString retrieves a string value from configuration by key. This enables dynamic access to config values without unmarshaling.
func WatchConfig ¶ added in v0.3.0
WatchConfig enables automatic configuration reloading on changes. The callback function will be called whenever the config file changes.
Types ¶
type CalibrationConfig ¶
type CalibrationConfig struct {
Enabled bool `mapstructure:"enabled"`
Schedule string `mapstructure:"schedule"`
BatchSize int `mapstructure:"batch_size"`
MinFeedbackThreshold int `mapstructure:"min_feedback_threshold"`
DecayRate float64 `mapstructure:"decay_rate"`
RecencyDecayDays int `mapstructure:"recency_decay_days"`
MaxFrequencyBoost float64 `mapstructure:"max_frequency_boost"`
CalibrationTimeout time.Duration `mapstructure:"calibration_timeout"`
}
CalibrationConfig holds confidence calibration settings.
type Config ¶
type Config struct {
Redis RedisConfig `mapstructure:"redis"`
MCP MCPConfig `mapstructure:"mcp"`
Logging LoggingConfig `mapstructure:"logging"`
Calibration CalibrationConfig `mapstructure:"calibration"`
}
Config holds all application configuration for the simplified server.
func Load ¶
Load reads configuration from a YAML file and applies environment overrides using Viper.
func LoadFromEnv ¶
func LoadFromEnv() *Config
LoadFromEnv creates a config purely from environment variables using Viper.
func LoadWithFormat ¶ added in v0.3.0
LoadWithFormat loads configuration from a file with automatic format detection. Viper supports YAML, JSON, TOML, HCL, and more formats automatically.
type LoggingConfig ¶
type LoggingConfig struct {
Level string `mapstructure:"level"`
Format string `mapstructure:"format"`
}
LoggingConfig holds logging settings.
type RedisConfig ¶
type RedisConfig struct {
Addr string `mapstructure:"addr"`
Password string `mapstructure:"password"`
DB int `mapstructure:"db"`
}
RedisConfig holds Redis connection configuration.