Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transformer ¶
Transformer is a configuration transformer.
func NewTransformer ¶
func NewTransformer(transformers []map[tree.Path]TransformerFunc) Transformer
NewTransformer creates a new transformer with the given transformers.
type TransformerFunc ¶
TransformerFunc is a function that transforms a part of the configuration. It modifies the data to conform to the expected structure and returns the transformed data. It takes the root configuration, the data to transform and the current path in the tree.
func MapToNamedSliceTransformer ¶
func MapToNamedSliceTransformer(name string) TransformerFunc
MapToNamedSliceTransformer converts a map of maps to a slice of maps and assigns the key to the "name" field.
func SpecConfigTransformer ¶
func SpecConfigTransformer(specName string) TransformerFunc
SpecConfigTransformer converts a map to a map with a "type" field and a "params" field.
type TransformerImpl ¶
type TransformerImpl struct {
// contains filtered or unexported fields
}
TransformerImpl is the implementation of the Transformer interface.
func (TransformerImpl) Transform ¶
func (t TransformerImpl) Transform(rawConfig *map[string]interface{}) (interface{}, error)
Transform applies the transformers to the configuration.