Documentation ¶
Index ¶
- Constants
- func Distill(left Values, right Values) (common Values, leftResidue Values, rightResidue Values)
- type ErrNoTable
- type ErrNoValue
- type ExtractValueSetArgs
- type PersistableValues
- type ValueMappings
- type ValueSet
- func (v ValueSet) Clone() ValueSet
- func (v *ValueSet) MarshalYAML() (interface{}, error)
- func (v *ValueSet) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (v ValueSet) WithDefaultSource(source string) ValueSet
- func (v ValueSet) WithDynamicValuesResolved(ctx command.ExecutionContext) (ValueSet, error)
- func (v ValueSet) WithFilesLoaded(pathResolver core.PathResolver) (ValueSet, error)
- func (v ValueSet) WithSource(source string) ValueSet
- func (v ValueSet) WithValueSetAtPath(path string, value interface{}, attribution string) (ValueSet, error)
- func (v ValueSet) WithValues(other ValueSet) ValueSet
- type ValueSetChain
- type ValueSetCollection
- func (v ValueSetCollection) CanonicalizedCopy() ValueSetCollection
- func (v ValueSetCollection) ExtractValueSet(args ExtractValueSetArgs) ValueSet
- func (v ValueSetCollection) ExtractValueSetByName(name string) ValueSet
- func (v ValueSetCollection) ExtractValueSetByNames(names ...string) ValueSet
- func (v ValueSetCollection) ExtractValueSetByRole(role core.EnvironmentRole) ValueSet
- func (v ValueSetCollection) ExtractValueSetByRoles(roles ...core.EnvironmentRole) ValueSet
- func (v ValueSetCollection) FindValueSetForRole(role core.EnvironmentRole) (ValueSet, error)
- func (v ValueSetCollection) MarshalYAML() (interface{}, error)
- func (v *ValueSetCollection) SetFromPath(fromPath string)
- func (v *ValueSetCollection) UnmarshalYAML(unmarshal func(interface{}) error) error
- type ValueSetCollectionProvider
- type ValueSets
- type Values
- func (v Values) AddEnvAsPath(prefix, envName string, value interface{}) error
- func (v Values) AsMap() map[string]interface{}
- func (v Values) Clone() Values
- func (v Values) Encode(w io.Writer) error
- func (v Values) GetAtPath(path string) (interface{}, error)
- func (v Values) Include(src Values)
- func (v Values) MakeAttributionValues(attribution string) Values
- func (v Values) Marshal(in interface{}) error
- func (v Values) MarshalJSON() ([]byte, error)
- func (v Values) Merge(src Values) Values
- func (v Values) MustSetAtPath(path string, value interface{})
- func (v Values) SetAtPath(path string, value interface{}) error
- func (v Values) Table(name string) (Values, error)
- func (v Values) ToEnv(prefix string) map[string]string
- func (v Values) ToMapStringInterface() map[string]interface{}
- func (v Values) Unmarshal(out interface{}) error
- func (v *Values) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (v Values) YAML() (string, error)
Constants ¶
const ValueSetAll = "all"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrNoTable ¶
type ErrNoTable error
ErrNoTable indicates that a chart does not have a matching table.
type ErrNoValue ¶
type ErrNoValue error
ErrNoValue indicates that Values does not contain a key with a value
type ExtractValueSetArgs ¶
type ExtractValueSetArgs struct { Names []string Roles []core.EnvironmentRole ExactMatch map[string]string }
type PersistableValues ¶
type PersistableValues struct { Attribution Values `yaml:"attribution"` Values Values `yaml:"values"` FilePath string `yaml:"-"` }
func (*PersistableValues) Cleanup ¶
func (r *PersistableValues) Cleanup()
func (*PersistableValues) PersistValues ¶
func (r *PersistableValues) PersistValues() (string, error)
func (*PersistableValues) Report ¶
func (r *PersistableValues) Report() string
type ValueMappings ¶
ValueMappings is a map of dotted value path to dotted value path. When ApplyToValues is called, it takes the values found at the key path and writes them to the value path.
func (ValueMappings) ApplyToValues ¶
func (v ValueMappings) ApplyToValues(target Values) error
type ValueSet ¶
type ValueSet struct { Source string `yaml:"source,omitempty"` StaticAttributions Values `yaml:"staticAttributions,omitempty"` DynamicAttributions Values `yaml:"dynamicAttributions,omitempty"` Roles []core.EnvironmentRole `yaml:"roles,flow,omitempty"` ExactMatchFilters filter.MatchMapConfig `yaml:"exactMatchFilters,omitempty"` Dynamic map[string]*command.CommandValue `yaml:"dynamic,omitempty" json:"dynamic,omitempty"` Files []string `yaml:"files,omitempty" json:"files,omitempty"` Static Values `yaml:"static,omitempty" json:"static,omitempty"` }
func ExtractValueSet ¶
func ExtractValueSet(provider ValueSetCollectionProvider, argsProvider filter.MatchMapArgContainer) ValueSet
func ExtractValueSetAdvanced ¶
func ExtractValueSetAdvanced(provider ValueSetCollectionProvider, args ExtractValueSetArgs) ValueSet
func NewValueSet ¶
func NewValueSet() ValueSet
func (*ValueSet) MarshalYAML ¶
func (*ValueSet) UnmarshalYAML ¶
func (ValueSet) WithDefaultSource ¶
Returns a value set with the source set if it wasn't set before.
func (ValueSet) WithDynamicValuesResolved ¶
func (v ValueSet) WithDynamicValuesResolved(ctx command.ExecutionContext) (ValueSet, error)
WithDynamicValuesResolved returns a ValueSet based on this instance, but with all dynamic values resolved and merged into the static values, and with all values which contain go templates rendered into their final values using the static values as of when this method was called.
func (ValueSet) WithFilesLoaded ¶
func (v ValueSet) WithFilesLoaded(pathResolver core.PathResolver) (ValueSet, error)
WithFilesLoaded returns a new ValueSet based on this one, but with all files loaded and merged UNDER existing static values.
func (ValueSet) WithSource ¶
func (ValueSet) WithValueSetAtPath ¶
func (ValueSet) WithValues ¶
WithValues returns a new ValueSet with the values from other added after (and/or overwriting) the values from this instance)
type ValueSetChain ¶
type ValueSetChain struct {
ValueSets ValueSets
}
func (*ValueSetChain) Append ¶
func (v *ValueSetChain) Append(source string, valueSet ValueSet)
func (*ValueSetChain) Prepend ¶
func (v *ValueSetChain) Prepend(source string, valueSet ValueSet)
type ValueSetCollection ¶
type ValueSetCollection struct { Disabled bool `yaml:"disabled"` DefaultValues ValueSet `yaml:"defaults"` ValueSets ValueSets `yaml:"custom"` }
ValueSetCollection is a map of (possibly multiple) names to ValueSets. The the keys can be single names (like "red") or multiple, comma-delimited names (like "red,green"). Use ExtractValueSetByName to get a merged ValueSet comprising the ValueSets under each key which contains that name.
func NewValueSetCollection ¶
func NewValueSetCollection() ValueSetCollection
func (ValueSetCollection) CanonicalizedCopy ¶
func (v ValueSetCollection) CanonicalizedCopy() ValueSetCollection
CanonicalizedCopy returns a copy of this ValueSetCollection with only single-role entries, by de-normalizing any multi-role entries. Each ValueSet will have its name set to the value of the name it's under.
func (ValueSetCollection) ExtractValueSet ¶
func (v ValueSetCollection) ExtractValueSet(args ExtractValueSetArgs) ValueSet
func (ValueSetCollection) ExtractValueSetByName ¶
func (v ValueSetCollection) ExtractValueSetByName(name string) ValueSet
ExtractValueSetByName returns a merged ValueSet comprising the ValueSets under each key which contains the provided names. ValueSets with the same name are merged in order from least specific key to most specific, so values under the key "red" will overwrite values under "red,green", which will overwrite values under "red,green,blue", and so on. Then the ValueSets with each name are merged in the order the names were provided.
func (ValueSetCollection) ExtractValueSetByNames ¶
func (v ValueSetCollection) ExtractValueSetByNames(names ...string) ValueSet
func (ValueSetCollection) ExtractValueSetByRole ¶
func (v ValueSetCollection) ExtractValueSetByRole(role core.EnvironmentRole) ValueSet
func (ValueSetCollection) ExtractValueSetByRoles ¶
func (v ValueSetCollection) ExtractValueSetByRoles(roles ...core.EnvironmentRole) ValueSet
func (ValueSetCollection) FindValueSetForRole ¶
func (v ValueSetCollection) FindValueSetForRole(role core.EnvironmentRole) (ValueSet, error)
func (ValueSetCollection) MarshalYAML ¶
func (v ValueSetCollection) MarshalYAML() (interface{}, error)
func (*ValueSetCollection) SetFromPath ¶
func (v *ValueSetCollection) SetFromPath(fromPath string)
func (*ValueSetCollection) UnmarshalYAML ¶
func (v *ValueSetCollection) UnmarshalYAML(unmarshal func(interface{}) error) error
type ValueSetCollectionProvider ¶
type ValueSetCollectionProvider interface {
GetValueSetCollection() ValueSetCollection
}
type Values ¶
type Values map[string]interface{}
Values represents a collection of chart values.
func ReadValues ¶
ReadValues will parse YAML byte data into a Values.
func ReadValuesFile ¶
ReadValuesFile will parse a YAML file into a map of values.
func (Values) AddEnvAsPath ¶
AddEnvAsPath turns an environment variable (like BOSUN_APP_VERSION) into a path (like app.version) by trimming the prefix, lower casing, and converting to dots, then adds it to the Values.
func (Values) AsMap ¶
AsMap is a utility function for converting Values to a map[string]interface{}.
It protects against nil map panics.
func (Values) GetAtPath ¶
SetAtPath adds value to Values at the provided path, which can be a compound name. If there table missing from the path, they will be created.
func (Values) Include ¶
Include takes any properties in src which are not in this instance and adds them to this instance.
func (Values) MakeAttributionValues ¶
func (Values) MarshalJSON ¶
func (Values) Merge ¶
Merge takes the properties in src and merges them into Values. Maps are merged (keys are overwritten) while values and arrays are replaced.
func (Values) MustSetAtPath ¶
MustSetAtPath adds value to Values at the provided path, which can be a compound name. This will panic if path is invalid, so it should only be used with literal string paths, not user provided ones.
func (Values) SetAtPath ¶
SetAtPath adds value to Values at the provided path, which can be a compound name. If there table missing from the path, they will be created.
func (Values) Table ¶
Table gets a table (YAML subsection) from a Values object.
The table is returned as a Values.
Compound table names may be specified with dots:
foo.bar
The above will be evaluated as "The table bar inside the table foo".
An ErrNoTable is returned if the table does not exist.
func (Values) ToEnv ¶
ToEnv returns a map with all the tables in the Values converted to _ delimited environment variables, prefixed with `prefix`.