Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader contains the data and logic needed to load a configuration object. Don't create instances of this type directly, use the NewLoader function instead.
func NewLoader ¶
func NewLoader() *Loader
NewLoader creates a builder that can then be used to create a new configuration object.
func (*Loader) Load ¶
Load uses the data stored in the loader to create and populate a configuration object.
func (*Loader) SetFlags ¶
SetFlags sets the command line flags that that indicate how to load the configuration. This is optional.
func (*Loader) SetLogger ¶
SetLogger sets the logger that the loader will use to write to the log. This is mandatory.
func (*Loader) SetSource ¶
SetSource sets the source for the configuration. It can be one of the following things:
- A string ending in `.yaml` or .`yml`. In this case it will be interpreted as the name of a YAML file containing the configuration.
- A string not ending in `.yaml`, `.yml`. In this case it will be interpredted as the content of the configuration itself.
- An array of bytes containing the configuration as an UTF-8 string.
- A io.Reader providing the configuration text.
This is mandatory.