transformers

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PathConfig

type PathConfig struct {
	// If true, it will create the path if it is not found.
	CreateIfNotPresent bool
	// The GVK that this path tied to.
	// If unset, it applied to any GVK
	// If some fields are set, it applies to all matching GVK.
	GroupVersionKind *schema.GroupVersionKind
	// Path to the field that will be munged.
	Path []string
}

PathConfig contains the configuration of a field, including the GVK it ties to, path to the field, etc.

type Transformer

type Transformer interface {
	// Transform modifies objects in a map, e.g. add prefixes or additional labels.
	Transform(m resource.ResourceCollection) error
}

Transformer can transform objects.

func NewDefaultingAnnotationsMapTransformer

func NewDefaultingAnnotationsMapTransformer(m map[string]string) (Transformer, error)

NewDefaultingAnnotationsMapTransformer construct a mapTransformer with defaultAnnotationsPathConfigs.

func NewDefaultingLabelsMapTransformer

func NewDefaultingLabelsMapTransformer(m map[string]string) (Transformer, error)

NewDefaultingLabelsMapTransformer construct a mapTransformer with defaultLabelsPathConfigs.

func NewDefaultingNamePrefixTransformer

func NewDefaultingNamePrefixTransformer(nameprefix string) (Transformer, error)

NewDefaultingNamePrefixTransformer construct a namePrefixTransformer with defaultNamePrefixPathConfigs.

func NewDefaultingNameReferenceTransformer

func NewDefaultingNameReferenceTransformer() (Transformer, error)

NewDefaultingNameReferenceTransformer constructs a nameReferenceTransformer with defaultNameReferencepathConfigs.

func NewMapTransformer

func NewMapTransformer(pc []PathConfig, m map[string]string) (Transformer, error)

NewMapTransformer construct a mapTransformer.

func NewMultiTransformer

func NewMultiTransformer(t []Transformer) Transformer

NewMultiTransformer constructs a multiTransformer.

func NewNameHashTransformer

func NewNameHashTransformer() Transformer

NewNameHashTransformer construct a nameHashTransformer.

func NewNamePrefixTransformer

func NewNamePrefixTransformer(pc []PathConfig, np string) (Transformer, error)

NewNamePrefixTransformer construct a namePrefixTransformer.

func NewNameReferenceTransformer

func NewNameReferenceTransformer(pc []referencePathConfig) (Transformer, error)

NewNameReferenceTransformer construct a nameReferenceTransformer.

func NewNoOpTransformer

func NewNoOpTransformer() Transformer

NewNoOpTransformer constructs a noOpTransformer.

func NewOverlayTransformer

func NewOverlayTransformer(overlay []*resource.Resource) (Transformer, error)

NewOverlayTransformer constructs a overlayTransformer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL