Documentation
¶
Overview ¶
Package configfile loads YAML configuration files with strict environment interpolation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidEnvironmentReference reports unsupported environment syntax in a // YAML scalar. ErrInvalidEnvironmentReference = errors.New("configfile.invalid_environment_reference") // ErrMissingEnvironmentVariables reports YAML references to unset // environment variables. ErrMissingEnvironmentVariables = errors.New("configfile.missing_environment_variables") // ErrMissingPath reports an empty config file path. ErrMissingPath = errors.New("configfile.missing_path") // ErrNilTarget reports a nil or non-pointer decode target. ErrNilTarget = errors.New("configfile.nil_target") // ErrParse reports malformed YAML or target decode failures. ErrParse = errors.New("configfile.parse") // ErrRead reports config file read failures. ErrRead = errors.New("configfile.read") )
Functions ¶
func InterpolateYAML ¶
InterpolateYAML expands environment variables only inside YAML scalar nodes.
func LoadYAML ¶
LoadYAML reads a YAML config file, expands environment variables only inside YAML scalar nodes, and decodes the result with KnownFields enabled.
func LoadYAMLBytes ¶
LoadYAMLBytes expands environment variables only inside YAML scalar nodes and decodes the result with KnownFields enabled.
Types ¶
type InvalidEnvironmentReferenceError ¶
type InvalidEnvironmentReferenceError struct {
Reference string
}
InvalidEnvironmentReferenceError identifies an unsupported interpolation reference.
func (InvalidEnvironmentReferenceError) Error ¶
func (invalidReferenceError InvalidEnvironmentReferenceError) Error() string
Error returns a stable invalid-reference error string.
func (InvalidEnvironmentReferenceError) Is ¶
func (invalidReferenceError InvalidEnvironmentReferenceError) Is(target error) bool
Is reports compatibility with ErrInvalidEnvironmentReference.
type MissingEnvironmentVariablesError ¶
type MissingEnvironmentVariablesError struct {
Names []string
}
MissingEnvironmentVariablesError identifies every unset environment variable referenced by a YAML document.
func (MissingEnvironmentVariablesError) Error ¶
func (missingVariablesError MissingEnvironmentVariablesError) Error() string
Error returns a stable missing-environment error string.
func (MissingEnvironmentVariablesError) Is ¶
func (missingVariablesError MissingEnvironmentVariablesError) Is(target error) bool
Is reports compatibility with ErrMissingEnvironmentVariables.