templating

package
v0.0.0-...-e0434a4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransformerKeywordInline = "${inline}"
)

Variables

This section is empty.

Functions

func FindInMapRecursive

func FindInMapRecursive(src map[string]interface{}, keyPath []string) (interface{}, error)

Recursively search in a map of maps for the specified key. keyPath contains the keys to use in the applicable (child)map

func Merge

func Merge(winner, loser interface{}) (interface{}, error)

Types

type SpecExpander

type SpecExpander struct {
	VarResolver      VariableResolver
	RequiredPrefix   string
	ReservedPrefixes []string // If the source prefix isn't matched and isn't any of these then it's an error
}

Used to expand "templated" variables in Specs

func (*SpecExpander) Expand

Resolves all the variables used in the resource spec

type TextParser

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

Parser for parsing the plain text part of a string

type VarParser

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

Parser for parsing variable references in a string

type VariableExpander

type VariableExpander interface {
	Expand(s string) (interface{}, *util.ErrorList)
	ValidPrefix(s string) bool
}

VariableExpander expands variables into the appropriate values

func NewVariableExpander

func NewVariableExpander(r VariableResolver, p string) VariableExpander

NewVariableExpander creates a variable expander that will use the specified resolver

type VariableResolver

type VariableResolver func(string) (interface{}, error)

VariableResolver resolves variable names to their values

type VariableValidator

type VariableValidator func(string) bool

Jump to

Keyboard shortcuts

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