vars

package
v6.7.3-0...-1f455d7 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 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

func Traverse

func Traverse(val interface{}, name string, fields []string) (interface{}, error)

Types

type CredVarsTracker

type CredVarsTracker struct {
	*Tracker
	CredVars Variables
}

func (*CredVarsTracker) Get

func (t *CredVarsTracker) Get(ref Reference) (interface{}, bool, error)

func (*CredVarsTracker) List

func (t *CredVarsTracker) List() ([]Reference, error)

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 KVPair

type KVPair struct {
	Ref   Reference
	Value interface{}
}

type KVPairs

type KVPairs []KVPair

func (KVPairs) Expand

func (f KVPairs) Expand() StaticVariables

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(ref Reference) (interface{}, bool, error)

func (MultiVars) List

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

type NamedVariables

type NamedVariables map[string]Variables

func (NamedVariables) Get

func (m NamedVariables) Get(ref Reference) (interface{}, bool, error)

Get checks var_source if presents, then forward var to underlying secret manager. A Reference 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() ([]Reference, error)

type Reference

type Reference struct {
	Source string
	Path   string
	Fields []string
}

func ParseReference

func ParseReference(name string) (Reference, error)

func (Reference) String

func (r Reference) String() string

type StaticVariables

type StaticVariables map[string]interface{}

func (StaticVariables) Flatten

func (v StaticVariables) Flatten() KVPairs

func (StaticVariables) Get

func (v StaticVariables) Get(ref Reference) (interface{}, bool, error)

func (StaticVariables) List

func (v StaticVariables) List() ([]Reference, error)

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 TrackedVarsIterator

type TrackedVarsIterator interface {
	YieldCred(string, string)
}

type TrackedVarsMap

type TrackedVarsMap map[string]string

TrackedVarsMap is a TrackedVarsIterator which populates interpolated secrets into a map. If there are multiple secrets with the same name, it only keeps the first value.

func (TrackedVarsMap) YieldCred

func (it TrackedVarsMap) YieldCred(k, v string)

type Tracker

type Tracker struct {
	Enabled bool
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker(on bool) *Tracker

func (*Tracker) IterateInterpolatedCreds

func (t *Tracker) IterateInterpolatedCreds(iter TrackedVarsIterator)

func (*Tracker) Track

func (t *Tracker) Track(varRef Reference, val interface{})

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 Variables

type Variables interface {
	Get(Reference) (interface{}, bool, error)
	List() ([]Reference, 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