vars

package
v6.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PresentDeprecated

func PresentDeprecated(content []byte) bool

Types

type CredVarsTracker

type CredVarsTracker interface {
	Variables
	IterateInterpolatedCreds(iter CredVarsTrackerIterator)
	Enabled() bool

	AddLocalVar(string, interface{}, bool)
}

func NewCredVarsTracker

func NewCredVarsTracker(credVars Variables, on bool) CredVarsTracker

type CredVarsTrackerIterator

type CredVarsTrackerIterator interface {
	YieldCred(string, string)
}

CredVarsTracker implements the interface Variables. It wraps a secret manager and tracks key-values fetched from the secret managers. It also provides a method to thread-safely iterate interpolated key-values.

type EvaluateOpts

type EvaluateOpts struct {
	ExpectAllKeys     bool
	ExpectAllVarsUsed bool
}

type InvalidFieldError

type InvalidFieldError struct {
	Name  string
	Field string
	Value interface{}
}

func (InvalidFieldError) Error

func (err InvalidFieldError) Error() string

type InvalidInterpolationError

type InvalidInterpolationError struct {
	Name  string
	Value interface{}
}

func (InvalidInterpolationError) Error

func (err InvalidInterpolationError) Error() string

type MapCredVarsTrackerIterator

type MapCredVarsTrackerIterator struct {
	Data map[string]interface{}
}

func NewMapCredVarsTrackerIterator

func NewMapCredVarsTrackerIterator() *MapCredVarsTrackerIterator

func (*MapCredVarsTrackerIterator) YieldCred

func (it *MapCredVarsTrackerIterator) YieldCred(k, v string)

type MissingFieldError

type MissingFieldError struct {
	Name  string
	Field string
}

func (MissingFieldError) Error

func (err MissingFieldError) Error() string

type MissingSourceError

type MissingSourceError struct {
	Name   string
	Source string
}

func (MissingSourceError) Error

func (err MissingSourceError) Error() string

type MultiVars

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

func NewMultiVars

func NewMultiVars(varss []Variables) MultiVars

func (MultiVars) Get

func (m MultiVars) Get(varDef VariableDefinition) (interface{}, bool, error)

func (MultiVars) List

func (m MultiVars) List() ([]VariableDefinition, error)

type NamedVariables

type NamedVariables map[string]Variables

func (NamedVariables) Get

func (m NamedVariables) Get(varDef VariableDefinition) (interface{}, bool, error)

Get checks var_source if presents, then forward var to underlying secret manager. A `varDef.Name` with a var_source looks like "myvault:foo", where "myvault" is the var_source name, and "foo" is the real var name that should be forwarded to the underlying secret manager.

func (NamedVariables) List

func (m NamedVariables) List() ([]VariableDefinition, error)

type StaticVariables

type StaticVariables map[string]interface{}

func (StaticVariables) Get

func (v StaticVariables) Get(varDef VariableDefinition) (interface{}, bool, error)

func (StaticVariables) List

type Template

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

func NewTemplate

func NewTemplate(bytes []byte) Template

func (Template) Evaluate

func (t Template) Evaluate(vars Variables, opts EvaluateOpts) ([]byte, error)

func (Template) ExtraVarNames

func (t Template) ExtraVarNames() []string

type TemplateResolver

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

func NewTemplateResolver

func NewTemplateResolver(configPayload []byte, params []Variables) TemplateResolver

Creates a template resolver, given a configPayload and a slice of param sources. If more than one param source is specified, they will be tried for variable lookup in the provided order. See implementation of NewMultiVars for details.

func (TemplateResolver) Resolve

func (resolver TemplateResolver) Resolve(expectAllKeys bool, allowEmptyInOldStyleTemplates bool) ([]byte, error)

func (TemplateResolver) ResolveDeprecated

func (resolver TemplateResolver) ResolveDeprecated(allowEmpty bool) ([]byte, error)

type UndefinedVarsError

type UndefinedVarsError struct {
	Vars []string
}

func (UndefinedVarsError) Error

func (err UndefinedVarsError) Error() string

type UnusedVarsError

type UnusedVarsError struct {
	Vars []string
}

func (UnusedVarsError) Error

func (err UnusedVarsError) Error() string

type VariableDefinition

type VariableDefinition struct {
	Ref     VariableReference
	Type    string
	Options interface{}
}

type VariableReference

type VariableReference struct {
	Name   string
	Source string
	Path   string
	Fields []string
}

type Variables

type Variables interface {
	Get(VariableDefinition) (interface{}, bool, error)
	List() ([]VariableDefinition, error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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