Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidConfig = errors.New("invalid configuration")
)
Functions ¶
Types ¶
type External ¶
type External struct {
// Required determines if the external configuration file is required. If
// the file is required and cannot be found, the program will exit with an
// error.
Required bool
// File is the path to the external configuration file based on the root path.
File string
// As is the alternate file extension to use when decoding the file. If empty,
// the file extension is used (like normal).
As string
// Origin is the origin of the external configuration file. This is used in
// by the configuration system to express where the configuration came from.
Origin string
// Remap is an array of from/to mappings that are used to remap the keys in the
// external configuration file to the keys in the internal configuration map.
Remap []Remap
// contains filtered or unexported fields
}
External represents an external configuration file that is used to populate a map of string values.
type Remap ¶
type Remap struct {
// From is the key in the external configuration file.
From string
// To is the key in the internal configuration map.
To string
// Optional determines if the key is optional. If the key is optional and cannot
// be found in the external configuration file, the key is not added to the internal
// configuration map. If the key is not optional and cannot be found, the program
// will exit with an error.
Optional bool
}
Remap represents a key remapping from the external configuration file to the internal configuration map.
Click to show internal directories.
Click to hide internal directories.