Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config interface {
// Err returns any internal errors that happened while processing input
Err() error
// From allows for reading from a writer and applying to the config
From(data io.Reader) Config
// ParseEnv reads from the environment and will apply the found values
// to the fields configured.
ParseEnv() Config
// ParseFlags will take an array of input and parse them
// applying to the internal config.
ParseFlags(args []string) Config
}
Config defines a basic interface that allows for wrapping behaviour for a nice config object
func Default ¶
func Default(values interface{}) Config
Default wraps the values and provides support for the configuration builder It will set the default decoder as json
func WithDecoding ¶
WithDecoding allows for a custom decoder to be used when running `From` if there is no valid decode, an error is returned.
Valid decodings are yaml, json, or toml.
Click to show internal directories.
Click to hide internal directories.