Closeable is an extension interface for ParserProvider that should be added if they need to be closed.
type ParserProvider ¶
ParserProvider is an interface that helps providing configuration's parser. Implementations may load the parser from a file, a database or any other source.
func Default() ParserProvider
Default is the default ParserProvider and it creates configuration from a file defined by the --config command line flag and overwrites properties from --set command line flag (if the flag is present).
func NewFile() ParserProvider
NewFile returns a new ParserProvider that reads the configuration from a file configured via the --config command line flag.
func NewInMemory ¶
NewInMemory returns a new ParserProvider that reads the configuration from the provided buffer as YAML.
func NewSetFlag ¶
NewSetFlag returns a config.ParserProvider, that wraps a "base" config.ParserProvider, then overrides properties from set flag(s) in the loaded Parser.
The implementation reads set flag(s) from the cmd and concatenates them as a "properties" file. Then the properties file is read and properties are set to the loaded Parser.