Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseSecrets ¶
ParseSecrets parses a newline-separated list of key=value pairs into a map. Empty lines and lines without '=' are silently ignored. Lines without '=' are treated as malformed and skipped to handle edge cases gracefully. This allows the function to continue processing other valid entries even if some lines are malformed. Keys or values containing newlines are skipped as malformed input.
func SaveConfig ¶
SaveConfig writes the configuration to the specified directory.
Types ¶
type Config ¶
type Config struct {
DefaultProvider string `yaml:"default_provider"`
Providers map[string]Provider `yaml:"providers"`
}
Config represents the application configuration.
func LoadConfig ¶
LoadConfig reads and parses the configuration file from the specified directory. Returns ErrConfigNotFound if the file doesn't exist. Automatically migrates old "config" file to "config.yaml" if needed.
type ConfigCache ¶ added in v1.8.0
type ConfigCache struct {
// contains filtered or unexported fields
}
func NewConfigCache ¶ added in v1.8.0
func NewConfigCache(ttl time.Duration) *ConfigCache
func (*ConfigCache) Get ¶ added in v1.8.0
func (c *ConfigCache) Get(configDir string) (*Config, error)
func (*ConfigCache) Invalidate ¶ added in v1.8.0
func (c *ConfigCache) Invalidate(configDir string)
type FileWatcher ¶ added in v1.8.0
type FileWatcher struct {
// contains filtered or unexported fields
}
func NewFileWatcher ¶ added in v1.8.0
func NewFileWatcher(configDir string, cache *ConfigCache, pollInterval time.Duration) *FileWatcher
func (*FileWatcher) Close ¶ added in v1.8.0
func (fw *FileWatcher) Close()