config

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConfigNotFound = errors.New("configuration file not found")

Functions

func ParseSecrets

func ParseSecrets(secrets string) map[string]string

ParseSecrets parses a newline-separated list of key=value pairs into a map. Empty lines and lines without '=' are ignored.

func SaveConfig

func SaveConfig(configDir string, cfg *Config) error

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

func LoadConfig(configDir string) (*Config, error)

LoadConfig reads and parses the configuration file from the specified directory. Returns ErrConfigNotFound if the file doesn't exist.

type Provider

type Provider struct {
	Name    string   `yaml:"name"`
	BaseURL string   `yaml:"base_url"`
	Model   string   `yaml:"model"`
	EnvVars []string `yaml:"env_vars"`
}

Provider represents a configured API provider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL