Documentation
¶
Index ¶
- Constants
- func DecodeSettings(settings map[string]any, out any) error
- func ExpandEnv(input string) (string, error)
- func LoadConfigDocument(runtimeOpts RuntimeLoadOptions, opts AppLoadOptions, out any) (string, error)
- func LoadResolvedSettings(runtimeOpts RuntimeLoadOptions, opts AppLoadOptions) (map[string]any, string, error)
- func ValidateSettings(settings map[string]any) error
- type AppLoadOptions
- type RuntimeConfig
- type RuntimeLoadOptions
Constants ¶
const (
// CoreConfigFileName is the fallback config file name.
CoreConfigFileName = "config.yaml"
)
Variables ¶
This section is empty.
Functions ¶
func DecodeSettings ¶
DecodeSettings decodes a settings map into a target struct using mapstructure tags.
func LoadConfigDocument ¶
func LoadConfigDocument(runtimeOpts RuntimeLoadOptions, opts AppLoadOptions, out any) (string, error)
LoadConfigDocument loads and decodes a full app config document into out.
The selected file is single-source by priority:
- default layout: <app>.yaml first, then config.yaml
- app-dir layout (UseDotConfigAppDir): .config/<app>/config.yaml (or config-dir override targets)
Profile overrides (profiles.<name>) and app env overrides are applied before decode.
func LoadResolvedSettings ¶
func LoadResolvedSettings(runtimeOpts RuntimeLoadOptions, opts AppLoadOptions) (map[string]any, string, error)
LoadResolvedSettings loads config defaults, merges the selected file, applies profile overlays and env overrides, and returns the final settings map.
func ValidateSettings ¶
ValidateSettings decodes and validates raw "runtime" settings.
Types ¶
type AppLoadOptions ¶
type AppLoadOptions struct {
AppName string
DefaultsYAML []byte
// UseDotConfigAppDir resolves config from app-specific .config layout:
// - <config-dir>/<app>/config.yaml, then <config-dir>/config.yaml
// - <working-dir>/.config/<app>/config.yaml
UseDotConfigAppDir bool
}
AppLoadOptions configures app config loading on top of runtime config.
type RuntimeConfig ¶
type RuntimeConfig struct {
Providers map[string]agentconfig.Config `json:"providers,omitempty" mapstructure:"providers" validate:"required,gt=0"`
MCPServers map[string]agentconfig.MCPServerConfig `json:"mcp_servers,omitempty" mapstructure:"mcp_servers" validate:"omitempty"`
}
RuntimeConfig contains runtime agent-factory settings.
Config shape:
runtime: providers: ... mcp_servers: ...
func (RuntimeConfig) Validate ¶
func (c RuntimeConfig) Validate() error
Validate validates the runtime config.
type RuntimeLoadOptions ¶
RuntimeLoadOptions configures runtime config loading.