Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Splitter = regexp.MustCompile(`,`)
Splitter is the regex used to split YAML_FILES and YAML_VARS
Functions ¶
func DecodeBase64Strings ¶
DecodeBase64Strings will decode all the base64 strings supplied
func ReadEnvVars ¶
ReadEnvVars will read all the environment variables named and return an array of their values. The order of the names to values will be preserved.
Types ¶
type ConfSources ¶
type ConfSources struct {
// Environment loads config from environment vars when true. The vars loaded
// are:
// YAML_FILES: comma separated values will be appended to Files
// YAML_VARS: comma separated values of other environment variables to read
// and whose base64 strings will be appended to Overrides
Environment bool
// Files is a list of filenames to read
Files []string
// Overrides are Base64 encoded strings of yaml
Overrides []string
// Patches are files containing JSON 6902 patches to apply after the merge
// is complete
Patches []string
// PatchStrings are strings containing JSON 6902 patches to apply after the
// merge is complete
PatchStrings []string
// An optional (can be nil) stream to read raw yaml (potentially multiple
// inline documents)
Stream io.Reader
}
ConfSources contains sources of yaml for loading. See Load() for precedence
func (ConfSources) LoadInterface ¶
func (s ConfSources) LoadInterface() (interface{}, error)
LoadInterface will load the config determined by settings in the struct. In order of precedence (highest last), Files, YAML_FILES env var, Overrides, YAML_VARS env var, Stream.
func (ConfSources) LoadSettableInterface ¶
func (s ConfSources) LoadSettableInterface() (interface{}, string, error)
LoadSettableInterface will load the config determined by settings in the struct. Will fail if more than one file source or any non-file source is indicated. Returns the conf, and the file that values can be set in.