transformers

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 9 Imported by: 7

Documentation

Overview

Utilities to aid transformer plugins.

TODO: Push remaining code down into the plugins or into an appropriately named utility package. This package made more sense in the pre-plugin days.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MutateField

func MutateField(
	m map[string]interface{},
	pathToField []string,
	createIfNotPresent bool,
	fns ...mutateFunc) error

func NewAnnotationsMapTransformer

func NewAnnotationsMapTransformer(
	m map[string]string, fs []config.FieldSpec) (resmap.Transformer, error)

NewAnnotationsMapTransformer construct a mapTransformer.

func NewLabelsMapTransformer

func NewLabelsMapTransformer(
	m map[string]string, fs []config.FieldSpec) (resmap.Transformer, error)

NewLabelsMapTransformer constructs a mapTransformer.

func NewMapTransformer

func NewMapTransformer(
	pc []config.FieldSpec, m map[string]string) (resmap.Transformer, error)

NewMapTransformer construct a mapTransformer.

func NewMultiTransformer

func NewMultiTransformer(t []resmap.Transformer) resmap.Transformer

NewMultiTransformer constructs a multiTransformer.

func NewNameReferenceTransformer

func NewNameReferenceTransformer(br []config.NameBackReferences) resmap.Transformer

NewNameReferenceTransformer constructs a nameReferenceTransformer with a given slice of NameBackReferences.

func NewNoOpTransformer

func NewNoOpTransformer() resmap.Transformer

NewNoOpTransformer constructs a noOpTransformer.

Types

type RefVarTransformer

type RefVarTransformer struct {
	// contains filtered or unexported fields
}

func NewRefVarTransformer

func NewRefVarTransformer(
	varMap map[string]interface{}, fs []config.FieldSpec) *RefVarTransformer

NewRefVarTransformer returns a new RefVarTransformer that replaces $(VAR) style variables with values. The fieldSpecs are the places to look for occurrences of $(VAR).

func (*RefVarTransformer) Transform

func (rv *RefVarTransformer) Transform(m resmap.ResMap) error

Transform replaces $(VAR) style variables with values.

func (*RefVarTransformer) UnusedVars

func (rv *RefVarTransformer) UnusedVars() []string

UnusedVars returns slice of Var names that were unused after a Transform run.

Directories

Path Synopsis
Package config provides the functions to load default or user provided configurations for different transformers
Package config provides the functions to load default or user provided configurations for different transformers
defaultconfig
Package defaultconfig provides the default transformer configurations
Package defaultconfig provides the default transformer configurations

Jump to

Keyboard shortcuts

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