Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultOptions = []interface{}{ ucfg.PathSep("."), ucfg.ResolveEnv, ucfg.VarExp, VarSkipKeys("inputs"), }
DefaultOptions defaults options used to read the configuration
var ErrNoConfiguration = errors.New("no configuration found")
ErrNoConfiguration is returned when no configuration are found.
Functions ¶
func DiscoverFiles ¶
DiscoverFiles takes a slices of wildcards patterns and try to discover all the matching files recursively and will stop on any errors.
Types ¶
type Config ¶
type Config ucfg.Config
Config custom type over a ucfg.Config to add new methods on the object.
func MustNewConfigFrom ¶
func MustNewConfigFrom(from interface{}) *Config
MustNewConfigFrom try to create a configuration based on the type passed as arguments and panic on failures.
func NewConfigFrom ¶
NewConfigFrom takes a interface and read the configuration like it was YAML.
type DiscoverFunc ¶
DiscoverFunc is a function that discovers a list of files to load.
func Discoverer ¶
func Discoverer(patterns ...string) DiscoverFunc
Discoverer returns a DiscoverFunc that discovers all files that match the given patterns.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader is used to load configuration from the paths including appending multiple input configurations.
func NewLoader ¶
NewLoader creates a new Loader instance to load configuration files from different paths.
func (*Loader) Load ¶
Load iterates over the list of files and loads the confguration from them. If a configuration file is under the folder set in `agent.config.inputs.path` it is appended to a list. If it is a regular config file, it is merged into the result config. The list of input configurations is merged into the result last.