Documentation
¶
Overview ¶
Package yaml provides the YAML configuration decoder for CONGA applications.
Register Decode with conga.App.RegisterDecoder to enable YAML configuration support:
app.RegisterDecoder(".yaml", yaml.Decode)
app.RegisterDecoder(".yml", yaml.Decode)
Key Mapping ¶
A top-level YAML key matches a flag's config tag as written or, when it has no tag, the flag name spelled in the app's key casing (conga.ConfigKeyCase, kebab-case by default). Other spellings and letter cases are unknown fields:
# config.yaml http-port: 8080 database-url: "postgres://localhost/db" max-retries: 5
Parse failures wrap ErrParse, and an empty document decodes to an empty map.
Numbers and timestamps ¶
Integers decode to int, or to uint64 above the int64 range. A plain integer literal outside both 64-bit ranges wraps ErrParse instead of decoding to an approximate float64 or a string. Unquoted timestamps decode to time.Time, which binds to a time.Time flag and reaches a string flag in RFC 3339 form.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrParse indicates a syntax or parsing error in YAML configuration. ErrParse = errors.New("yaml parse error") )
Functions ¶
Types ¶
This section is empty.