Documentation ¶
Index ¶
- Constants
- Variables
- func JSONifyFiles(paths []string, strict bool) ([]string, error)
- func JSONifyIO(in io.Reader, strict bool) (string, error)
- func Merge(l ...map[interface{}]interface{}) (map[interface{}]interface{}, error)
- func RegisterOp(name string, op Operator)
- func ResolveEnv(nodes []string) []string
- func SetupOperators(phase OperatorPhase) error
- func SilenceWarnings(should bool)
- type Action
- type AwsOperator
- type Base64DecodeOperator
- type Base64Operator
- type CalcOperator
- type CartesianProductOperator
- func (CartesianProductOperator) Dependencies(_ *Evaluator, args []*Expr, locs []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
- func (CartesianProductOperator) Phase() OperatorPhase
- func (CartesianProductOperator) Run(ev *Evaluator, args []*Expr) (*Response, error)
- func (CartesianProductOperator) Setup() error
- type ConcatOperator
- type DeferOperator
- type DiffList
- type DiffMap
- type DiffNone
- type DiffScalar
- type DiffType
- type Diffable
- type EmptyOperator
- type ErrorContext
- type Evaluator
- func (ev *Evaluator) CheckForCycles(maxDepth int) error
- func (ev *Evaluator) CherryPick(paths []string) error
- func (ev *Evaluator) DataFlow(phase OperatorPhase) ([]*Opcall, error)
- func (ev *Evaluator) Prune(paths []string) error
- func (ev *Evaluator) Run(prune []string, picks []string) error
- func (ev *Evaluator) RunOp(op *Opcall) error
- func (ev *Evaluator) RunOps(ops []*Opcall) error
- func (ev *Evaluator) RunPhase(p OperatorPhase) error
- func (ev *Evaluator) SortPaths(pathKeyMap map[string]string) error
- type Expr
- type ExprType
- type FileOperator
- type GrabOperator
- type InjectOperator
- type IpsOperator
- type JoinOperator
- type KeysOperator
- type LoadOperator
- type Merger
- type ModificationDefinition
- type MultiError
- type NegateOperator
- type NullOperator
- type Opcall
- type Operator
- type OperatorPhase
- type ParamOperator
- type PruneOperator
- type Response
- type ShuffleOperator
- type SortOperator
- type StaticIPOperator
- type StringifyOperator
- type Type
- type VaultOperator
- type WarningError
Constants ¶
const UNDEFINED_AZ = "__UNDEFINED_AZ__"
Variables ¶
var OpRegistry map[string]Operator
OpRegistry ...
var SkipAws bool
SkipAws toggles whether AwsOperator will attempt to query AWS for any value When true will always return "REDACTED"
var SkipVault bool
SkipVault toggles whether calls to the Vault operator actually cause the Vault to be contacted and the keys substituted in.
var UsedIPs map[string]string
UsedIPs ...
var VaultRefs = map[string][]string{}
VaultRefs maps secret path to paths in YAML structure which call for it
Functions ¶
func JSONifyFiles ¶ added in v1.0.2
func Merge ¶ added in v0.13.0
func Merge(l ...map[interface{}]interface{}) (map[interface{}]interface{}, error)
Merge ...
func ResolveEnv ¶ added in v1.31.0
func SetupOperators ¶ added in v0.13.0
func SetupOperators(phase OperatorPhase) error
SetupOperators ...
func SilenceWarnings ¶ added in v1.8.14
func SilenceWarnings(should bool)
SilenceWarnings when called with true will make it so that warnings will not print when Warn is called. Calling it with false will make warnings visible again. Warnings will print by default.
Types ¶
type AwsOperator ¶ added in v1.22.0
type AwsOperator struct {
// contains filtered or unexported fields
}
AwsOperator provides two operators; (( awsparam "path" )) and (( awssecret "name_or_arn" )) It will fetch parameters / secrets from the respective AWS service
func (AwsOperator) Dependencies ¶ added in v1.22.0
func (AwsOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies is not used by AwsOperator
type Base64DecodeOperator ¶ added in v1.31.0
type Base64DecodeOperator struct{}
Base64DecodeOperator ...
func (Base64DecodeOperator) Dependencies ¶ added in v1.31.0
func (Base64DecodeOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
func (Base64DecodeOperator) Phase ¶ added in v1.31.0
func (Base64DecodeOperator) Phase() OperatorPhase
Phase ...
func (Base64DecodeOperator) Run ¶ added in v1.31.0
func (Base64DecodeOperator) Run(ev *Evaluator, args []*Expr) (*Response, error)
Run ...
func (Base64DecodeOperator) Setup ¶ added in v1.31.0
func (Base64DecodeOperator) Setup() error
Setup ...
type Base64Operator ¶ added in v1.23.0
type Base64Operator struct{}
Base64Operator ...
func (Base64Operator) Dependencies ¶ added in v1.23.0
func (Base64Operator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
func (Base64Operator) Phase ¶ added in v1.23.0
func (Base64Operator) Phase() OperatorPhase
Phase ...
type CalcOperator ¶ added in v1.8.7
type CalcOperator struct{}
CalcOperator is invoked with (( calc <expression> ))
func (CalcOperator) Dependencies ¶ added in v1.8.7
func (CalcOperator) Dependencies(ev *Evaluator, args []*Expr, _ []*tree.Cursor, _ []*tree.Cursor) []*tree.Cursor
Dependencies ...
type CartesianProductOperator ¶ added in v1.0.0
type CartesianProductOperator struct{}
CartesianProductOperator ...
func (CartesianProductOperator) Dependencies ¶ added in v1.0.0
func (CartesianProductOperator) Dependencies(_ *Evaluator, args []*Expr, locs []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
func (CartesianProductOperator) Phase ¶ added in v1.0.0
func (CartesianProductOperator) Phase() OperatorPhase
Phase ...
func (CartesianProductOperator) Run ¶ added in v1.0.0
func (CartesianProductOperator) Run(ev *Evaluator, args []*Expr) (*Response, error)
Run ...
func (CartesianProductOperator) Setup ¶ added in v1.0.0
func (CartesianProductOperator) Setup() error
Setup ...
type ConcatOperator ¶ added in v0.13.0
type ConcatOperator struct{}
ConcatOperator ...
func (ConcatOperator) Dependencies ¶ added in v0.13.0
func (ConcatOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
func (ConcatOperator) Phase ¶ added in v0.13.0
func (ConcatOperator) Phase() OperatorPhase
Phase ...
type DeferOperator ¶ added in v1.11.0
type DeferOperator struct{}
DeferOperator sheds the "defer" command off of (( defer args args args )) and leaves (( args args args ))
func (DeferOperator) Dependencies ¶ added in v1.11.0
func (DeferOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, _ []*tree.Cursor) []*tree.Cursor
Dependencies returns an empty slice - defer produces no deps at all.
func (DeferOperator) Phase ¶ added in v1.11.0
func (DeferOperator) Phase() OperatorPhase
Phase gives back Param phase in this case, because we don't want any following phases to pick up the operator post-deference
func (DeferOperator) Run ¶ added in v1.11.0
func (DeferOperator) Run(_ *Evaluator, args []*Expr) (*Response, error)
Run chops off "defer" and leaves the args in double parens. Need to reconstruct the operator string
func (DeferOperator) Setup ¶ added in v1.11.0
func (DeferOperator) Setup() error
Setup doesn't do anything for Defer. We're a pretty lightweight operator.
type DiffList ¶ added in v1.8.10
type DiffMap ¶ added in v1.8.10
type DiffScalar ¶ added in v1.8.10
func (DiffScalar) Changed ¶ added in v1.8.10
func (d DiffScalar) Changed() bool
func (DiffScalar) String ¶ added in v1.8.10
func (d DiffScalar) String(key string) string
func (DiffScalar) Value ¶ added in v1.8.10
func (d DiffScalar) Value() interface{}
type EmptyOperator ¶ added in v1.8.0
type EmptyOperator struct{}
EmptyOperator allows the user to emplace an empty array, hash, or string into the YAML datastructure.
func (EmptyOperator) Dependencies ¶ added in v1.8.0
func (EmptyOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, _ []*tree.Cursor) []*tree.Cursor
Dependencies ...
type ErrorContext ¶ added in v1.8.14
type ErrorContext uint
An ErrorContext is a flag or set of flags representing the contexts that an error should have a special meaning in.
type Evaluator ¶ added in v0.13.0
type Evaluator struct { Tree map[interface{}]interface{} Deps map[string][]tree.Cursor SkipEval bool Here *tree.Cursor CheckOps []*Opcall Only []string // contains filtered or unexported fields }
Evaluator ...
func (*Evaluator) CheckForCycles ¶ added in v0.13.0
CheckForCycles ...
func (*Evaluator) CherryPick ¶ added in v1.8.2
Cherry-pick ...
func (*Evaluator) DataFlow ¶ added in v0.13.0
func (ev *Evaluator) DataFlow(phase OperatorPhase) ([]*Opcall, error)
DataFlow ...
func (*Evaluator) RunPhase ¶ added in v0.13.0
func (ev *Evaluator) RunPhase(p OperatorPhase) error
RunPhase ...
type Expr ¶ added in v0.13.0
type Expr struct { Type ExprType Reference *tree.Cursor Literal interface{} Name string Left *Expr Right *Expr }
Expr ...
func (*Expr) Dependencies ¶ added in v0.13.0
Dependencies ...
type FileOperator ¶ added in v1.5.0
type FileOperator struct{}
FileOperator ...
func (FileOperator) Dependencies ¶ added in v1.5.0
func (FileOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
type GrabOperator ¶ added in v0.13.0
type GrabOperator struct{}
GrabOperator ...
func (GrabOperator) Dependencies ¶ added in v0.13.0
func (GrabOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
type InjectOperator ¶ added in v0.13.0
type InjectOperator struct{}
InjectOperator ...
func (InjectOperator) Dependencies ¶ added in v0.13.0
func (InjectOperator) Dependencies(ev *Evaluator, args []*Expr, locs []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
func (InjectOperator) Phase ¶ added in v0.13.0
func (InjectOperator) Phase() OperatorPhase
Phase ...
type IpsOperator ¶ added in v1.13.0
type IpsOperator struct{}
IpOperator...
func (IpsOperator) Dependencies ¶ added in v1.13.0
func (IpsOperator) Dependencies(_ *Evaluator, args []*Expr, locs []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
type JoinOperator ¶ added in v1.5.0
type JoinOperator struct{}
JoinOperator is invoked with (( join <separator> <lists/strings>... )) and joins lists and strings into one string, separated by <separator>
func (JoinOperator) Dependencies ¶ added in v1.5.0
func (JoinOperator) Dependencies(ev *Evaluator, args []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies returns the nodes that (( join ... )) requires to be resolved before its evaluation. Returns no dependencies on error, because who cares about eval order if Run is going to bomb out anyway.
type KeysOperator ¶ added in v1.1.0
type KeysOperator struct{}
KeysOperator ...
func (KeysOperator) Dependencies ¶ added in v1.1.0
func (KeysOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
type LoadOperator ¶ added in v1.19.0
type LoadOperator struct{}
LoadOperator is invoked with (( load <location> ))
func (LoadOperator) Dependencies ¶ added in v1.19.0
func (LoadOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
type Merger ¶ added in v0.9.0
type Merger struct { AppendByDefault bool Errors MultiError // contains filtered or unexported fields }
Merger ...
type ModificationDefinition ¶ added in v1.7.0
type ModificationDefinition struct {
// contains filtered or unexported fields
}
ModificationDefinition encapsulates the details of an array modification: (1) the type of modification, e.g. insert, delete, replace (2) an optional guide to the specific part of the array to be modified,
for example the index at which an insertion should be done
(3) an optional list of entries to be added or merged into the array
type NegateOperator ¶ added in v1.29.0
type NegateOperator struct{}
NegateOperator ...
func (NegateOperator) Dependencies ¶ added in v1.29.0
func (NegateOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
func (NegateOperator) Phase ¶ added in v1.29.0
func (NegateOperator) Phase() OperatorPhase
Phase ...
type NullOperator ¶ added in v0.13.0
type NullOperator struct {
Missing string
}
NullOperator ...
func (NullOperator) Dependencies ¶ added in v0.13.0
func (NullOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, _ []*tree.Cursor) []*tree.Cursor
Dependencies ...
type Opcall ¶ added in v0.13.0
type Opcall struct {
// contains filtered or unexported fields
}
Opcall ...
func ParseOpcall ¶ added in v0.13.0
func ParseOpcall(phase OperatorPhase, src string) (*Opcall, error)
ParseOpcall ...
func (*Opcall) Dependencies ¶ added in v0.13.0
Dependencies ...
type Operator ¶ added in v0.13.0
type Operator interface { // setup whatever global/static state needed -- see (( static_ips ... )) Setup() error // evaluate the tree and determine what should be done to satisfy caller Run(ev *Evaluator, args []*Expr) (*Response, error) // returns a set of implicit / inherent dependencies used by Run() Dependencies(ev *Evaluator, args []*Expr, locs []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor // what phase does this operator run during? Phase() OperatorPhase }
Operator ...
type OperatorPhase ¶ added in v0.13.0
type OperatorPhase int
OperatorPhase ...
const ( // MergePhase ... MergePhase OperatorPhase = iota // EvalPhase ... EvalPhase // ParamPhase ... ParamPhase )
type ParamOperator ¶ added in v0.13.0
type ParamOperator struct{}
ParamOperator ...
func (ParamOperator) Dependencies ¶ added in v0.13.0
func (ParamOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, _ []*tree.Cursor) []*tree.Cursor
Dependencies ...
type PruneOperator ¶ added in v1.7.0
type PruneOperator struct{}
PruneOperator ...
func (PruneOperator) Dependencies ¶ added in v1.7.0
func (PruneOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
type Response ¶ added in v0.13.0
type Response struct { Type Action Value interface{} }
Response ...
type ShuffleOperator ¶ added in v1.27.0
type ShuffleOperator struct{}
ShuffleOperator ...
func (ShuffleOperator) Dependencies ¶ added in v1.27.0
func (ShuffleOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
func (ShuffleOperator) Phase ¶ added in v1.27.0
func (ShuffleOperator) Phase() OperatorPhase
Phase ...
type SortOperator ¶ added in v1.18.1
type SortOperator struct{}
SortOperator ...
func (SortOperator) Dependencies ¶ added in v1.18.1
func (SortOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
type StaticIPOperator ¶ added in v0.13.0
type StaticIPOperator struct{}
StaticIPOperator ...
func (StaticIPOperator) Dependencies ¶ added in v0.13.0
func (StaticIPOperator) Dependencies(ev *Evaluator, _ []*Expr, _ []*tree.Cursor, _ []*tree.Cursor) []*tree.Cursor
Dependencies ...
func (StaticIPOperator) Phase ¶ added in v0.13.0
func (StaticIPOperator) Phase() OperatorPhase
Phase ...
type StringifyOperator ¶ added in v1.28.0
type StringifyOperator struct{}
StringifyOperator ...
func (StringifyOperator) Dependencies ¶ added in v1.28.0
func (StringifyOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies ...
func (StringifyOperator) Phase ¶ added in v1.28.0
func (StringifyOperator) Phase() OperatorPhase
Phase ...
type VaultOperator ¶ added in v1.0.0
type VaultOperator struct{}
The VaultOperator provides a means of injecting credentials and other secrets from a Vault (vaultproject.io) Secure Key Storage instance.
func (VaultOperator) Dependencies ¶ added in v1.0.0
func (VaultOperator) Dependencies(_ *Evaluator, _ []*Expr, _ []*tree.Cursor, auto []*tree.Cursor) []*tree.Cursor
Dependencies collects implicit dependencies that a given `(( vault ... ))` call has. There are no dependencies other that those given as args to the command.
func (VaultOperator) Phase ¶ added in v1.0.0
func (VaultOperator) Phase() OperatorPhase
Phase identifies what phase of document management the vault operator should be evaluated in. Vault lives in the Eval phase
type WarningError ¶ added in v1.8.14
type WarningError struct {
// contains filtered or unexported fields
}
WarningError should produce a warning message to stderr if the context set for the error fits the context the error was caught in.
func NewWarningError ¶ added in v1.8.14
func NewWarningError(context ErrorContext, warning string, args ...interface{}) (err WarningError)
NewWarningError returns a new WarningError object that has the given warning message and context(s) assigned. Assigning no context should mean that all contexts are active. Ansi library enabled.
func (WarningError) Error ¶ added in v1.8.14
func (e WarningError) Error() string
Error will return the configured warning message as a string
func (WarningError) HasContext ¶ added in v1.8.14
func (e WarningError) HasContext(context ErrorContext) bool
HasContext returns true if the WarningError was configured with the given context (or all). False otherwise.
func (WarningError) Warn ¶ added in v1.8.14
func (e WarningError) Warn()
Warn prints the configured warning to stderr.
Source Files ¶
- diff.go
- errors.go
- evaluator.go
- json.go
- merge.go
- op_aws.go
- op_base64.go
- op_base64_decode.go
- op_calc.go
- op_cartesian_product.go
- op_concat.go
- op_defer.go
- op_empty.go
- op_file.go
- op_grab.go
- op_inject.go
- op_ips.go
- op_join.go
- op_keys.go
- op_load.go
- op_negate.go
- op_null.go
- op_param.go
- op_prune.go
- op_shuffle.go
- op_sort.go
- op_static_ips.go
- op_stringify.go
- op_vault.go
- operator.go