Documentation
¶
Overview ¶
Package config handles configuration loading from CLI flags, environment variables, and TOML files. CRC: crc-Config.md Spec: deployment.md
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Server ServerConfig `toml:"server"`
Lua LuaConfig `toml:"lua"`
Session SessionConfig `toml:"session"`
Logging LoggingConfig `toml:"logging"`
}
Config holds all configuration settings for the UI server.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a Config with all default values.
func Load ¶
Load loads configuration from CLI flags, environment variables, and TOML file. Priority: CLI flags > env vars > TOML file > defaults
type Duration ¶
Duration is a time.Duration that can be unmarshaled from TOML strings.
func (*Duration) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler for Duration.
type LoggingConfig ¶
type LoggingConfig struct {
Level string `toml:"level"` // "debug", "info", "warn", "error"
Verbosity int `toml:"verbosity"` // 0=none, 1=connections, 2=messages, 3=variables, 4=values
}
LoggingConfig holds logging settings.
type ServerConfig ¶
type ServerConfig struct {
Host string `toml:"host"`
Port int `toml:"port"`
Socket string `toml:"socket"`
Dir string `toml:"-"` // Custom site directory (CLI only, not in config file)
}
ServerConfig holds server-related settings.
type SessionConfig ¶
type SessionConfig struct {
Timeout Duration `toml:"timeout"` // Session expiration (0 = never)
}
SessionConfig holds session-related settings.