Core Concepts of koanf
masterUnderstanding the two primary interfaces:
koanf.Provider: A generic interface that provides configuration. It can return raw bytes (which require a parser) or a nestedmap[string]any(which can be loaded directly).koanf.Parser: A generic interface that takes raw bytes and returns a nestedmap[string]any(e.g., JSON or YAML parsers).- Key Paths: Once loaded, configuration values are accessed using a delimited key path syntax, such as
app.server.port. The delimiter is configurable (e.g.,.,/). - Merging: Multiple sources can be loaded into a single
koanfinstance. SuccessiveLoad()calls merge new configuration into the existing state.