Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigNotSupported ¶
ConfigNotSupported verifies that the provided bytes represent empty YAML. If the YAML is non-empty, return an error.
func ConfigVersion ¶
ConfigVersion unmarshals the provided bytes as YAML and returns the value of the top-level "version" key. The value of this key must be a string. If the input is valid YAML but does not contain a "version" key, returns the empty string. Returns an error if the input is not valid YAML or cannot be unmarshaled as YAML as specified.
func IsLegacyConfig ¶
func TrimLegacyPrefix ¶
TrimLegacyPrefix trims the "legacy-config: true" YAML key/value if it is the first line in the provided bytes. If the provided bytes do not start with this line, the input is returned directly. Returns true if the prefix is trimmed, false otherwise.
Types ¶
type ConfigWithLegacy ¶
type ConfigWithLegacy struct {
Legacy bool `yaml:"legacy-config"`
}
ConfigWithLegacy is a struct with a "legacy" YAML field that stores a boolean that indicates whether or not the configuration is "legacy" configuration.
type ConfigWithVersion ¶
type ConfigWithVersion struct {
Version string `yaml:"version,omitempty"`
}
ConfigWithVersion is a struct with a "version" YAML field that stores the version as a string.