Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶ added in v0.9.0
type Config struct {
xtemplate.Config
Listen string `json:"listen" arg:"-l,--listen"`
LogLevel int `json:"log_level" arg:"--loglevel" default:"-2"`
Configs []string `json:"-" arg:"-c,--config,separate"`
ConfigFiles []string `json:"-" arg:"-f,--config-file,separate"`
}
Config is the CLI app configuration: listen address, log level, and embedded xtemplate.Config for template/server options.
func LoadConfig ¶ added in v0.9.0
LoadConfig merges configuration: CLI flags > inline JSON > files > defaults. Pipeline: defaults → pass0 bootstrap → merge JSON → materialize controller (CLI type > JSON > default) → parse CLI (help/version exit via go-arg) → finalize. Pass nil for os.Args[1:].
func (*Config) SetDefaults ¶ added in v0.9.0
func (a *Config) SetDefaults()
SetDefaults sets the default values for this Config.
func (*Config) UnmarshalJSON ¶ added in v0.11.0
UnmarshalJSON fills app + embedded xtemplate fields. Uses a method-less Config alias so listen/log_level are not dropped. listen and log_level overwrite only when present so defaults survive omitted keys. Call CheckLegacyTemplateKeys before this when needed (LoadConfig does).