Documentation
¶
Overview ¶
Package configyaml loads a YAML config file into a Go struct, resolving any "{{env:NAME}}" (read from an env var) or "{{file:/path}}" (read from a mounted file) placeholder found in it via github.com/OpenNSW/core/secret.
Resolution runs generically over the parsed YAML tree before it is decoded into any typed struct, so the config types passed to LoadAndExpand never need to know which of their own fields might be sourced from an env var or a file — that's a property of how the YAML file was authored, not of the Go type reading it. This pairs with the `yaml` struct tags already carried by config types such as database.Config, temporal.Config, and cors.Config: embed those (or your own) in an application config struct and load it with LoadAndExpand.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadAndExpand ¶
LoadAndExpand reads the YAML file at path, resolves every "{{env:NAME}}" / "{{file:/path}}" placeholder in it, and decodes the result into v (a pointer, as for yaml.Unmarshal).
Types ¶
This section is empty.