dynaml

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: Apache-2.0 Imports: 37 Imported by: 11

Documentation

Index

Constants

View Source
const (
	TEMPORARY = "&temporary"
	TEMPLATE  = "&template"
	LOCAL     = "&local"
	INJECT    = "&inject"
	DEFAULT   = "&default"
	STATE     = "&state"
)
View Source
const CATCH_ERROR = "error"
View Source
const CATCH_VALID = "valid"
View Source
const CATCH_VALUE = "value"
View Source
const DNS1035LabelMaxLength int = 63
View Source
const DNS1123LabelMaxLength int = 63
View Source
const DNS1123SubdomainMaxLength int = 253
View Source
const F_ParseURL = "parseurl"
View Source
const MaxInt = int64(MaxUint >> 1)
View Source
const MaxUint = ^uint64(0)
View Source
const (
	OpAnd = "-and"
)
View Source
const (
	OpOr = "-or"
)
View Source
const TYPE_FLOAT = 2
View Source
const TYPE_INT = 1
View Source
const TYPE_NUMBER = TYPE_FLOAT | TYPE_INT

Variables

View Source
var MapToListContext = &mapToListContext{defaultContext{brackets: "[]", keyword: "map", list: true}}
View Source
var MapToMapContext = &mapToMapContext{defaultContext{brackets: "{}", keyword: "map", list: false}}
View Source
var SelectToListContext = &selectToListContext{defaultContext{brackets: "[]", keyword: "select", list: true}}
View Source
var SelectToMapContext = &selectToMapContext{defaultContext{brackets: "{}", keyword: "select", list: false}}

Functions

func Base64Encode added in v1.3.0

func Base64Encode(data []byte, max int) string

func CatchEvaluationError added in v1.3.0

func CatchEvaluationError(result *interface{}, info *EvaluationInfo, ok *bool, msgfmt string, args ...interface{})

func DiffIP added in v1.2.0

func DiffIP(a, b net.IP) int64

func EmptyError added in v1.3.0

func EmptyError() string

EmptyError returns a string explanation of a "must not be empty" validation failure.

func EvalValidationExpression added in v1.6.0

func EvalValidationExpression(value interface{}, cond yaml.Node, binding Binding) (bool, string, error, bool)

func ExpressionType added in v1.3.0

func ExpressionType(elem interface{}) string

func IPAdd added in v1.2.0

func IPAdd(ip net.IP, offset int64) net.IP

func IsDNS1035Label added in v1.3.0

func IsDNS1035Label(value string) []string

IsDNS1035Label tests for a string that conforms to the definition of a label in DNS (RFC 1035).

func IsDNS1123Label added in v1.3.0

func IsDNS1123Label(value string) []string

IsDNS1123Label tests for a string that conforms to the definition of a label in DNS (RFC 1123).

func IsDNS1123Subdomain added in v1.3.0

func IsDNS1123Subdomain(value string) []string

IsDNS1123Subdomain tests for a string that conforms to the definition of a subdomain in DNS (RFC 1123).

func IsListExpansion added in v1.4.0

func IsListExpansion(e Expression) bool

func IsWildcardDNS1123Subdomain added in v1.3.0

func IsWildcardDNS1123Subdomain(value string) []string

IsWildcardDNS1123Subdomain tests for a string that conforms to the definition of a wildcard subdomain in DNS (RFC 1034 section 4.3.3).

func MakeStringList added in v1.4.0

func MakeStringList(list []string, info EvaluationInfo) []yaml.Node

func MaxIP added in v1.2.0

func MaxIP(cidr *net.IPNet) net.IP

func MaxLenError added in v1.3.0

func MaxLenError(length int) string

MaxLenError returns a string explanation of a "string too long" validation failure.

func NewNode added in v1.3.0

func NewNode(val interface{}, src SourceProvider) yaml.Node

func NumberOperands added in v1.6.0

func NumberOperands(a, b interface{}) (interface{}, interface{}, error)

func NumberOperandsN added in v1.6.0

func NumberOperandsN(convert int, ops ...interface{}) ([]interface{}, bool, error)

func PathComponents added in v1.3.0

func PathComponents(ref string, leading bool) []string

func RaiseEvaluationError added in v1.3.0

func RaiseEvaluationError(resolved bool, info EvaluationInfo, ok bool)

func RaiseEvaluationErrorf added in v1.3.0

func RaiseEvaluationErrorf(format string, args ...interface{})

func RegexError added in v1.3.0

func RegexError(msg string, fmt string, examples ...string) string

RegexError returns a string explanation of a regex validation failure.

func RegisterFunction added in v1.2.0

func RegisterFunction(name string, f Function)

func RegisterValidator added in v1.3.0

func RegisterValidator(name string, f Validator)

func ReloadEnv added in v1.2.0

func ReloadEnv()

func ReplaceRegExp added in v1.3.0

func ReplaceRegExp(str string, src string, dst interface{}, cnt int, binding Binding) (bool, string, error)

func ReplaceString added in v1.3.0

func ReplaceString(str string, src string, dst interface{}, cnt int, binding Binding) (bool, string, error)

func ResetUnresolvedNodes added in v1.2.0

func ResetUnresolvedNodes(root yaml.Node) yaml.Node

func SimpleValidatorResult added in v1.3.0

func SimpleValidatorResult(r bool, t, f string, args ...interface{}) (bool, string, error, bool)

func StringValue added in v1.3.0

func StringValue(msg string, v interface{}) (string, error)

func SubIP added in v1.2.0

func SubIP(ip net.IP, mask net.IPMask) net.IP

func ValidatorErrorf added in v1.3.0

func ValidatorErrorf(msgfmt string, args ...interface{}) (bool, string, error, bool)

func ValidatorResult added in v1.3.0

func ValidatorResult(r bool, msgfmt string, args ...interface{}) (bool, string, error, bool)

func ValueAsString added in v1.4.0

func ValueAsString(val interface{}, all bool) string

Types

type AdditionExpr

type AdditionExpr struct {
	A Expression
	B Expression
}

func (AdditionExpr) Evaluate

func (e AdditionExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (AdditionExpr) String

func (e AdditionExpr) String() string

type Assignment added in v1.2.0

type Assignment struct {
	Key   Expression
	Value Expression
}

func (Assignment) String added in v1.2.0

func (e Assignment) String() string

type AutoExpr

type AutoExpr struct {
	Path []string
}

func (AutoExpr) Evaluate

func (e AutoExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (AutoExpr) String

func (e AutoExpr) String() string

type Binding

type Binding interface {
	SourceProvider
	GetStaticBinding() map[string]yaml.Node
	GetRootBinding() map[string]yaml.Node

	FindFromRoot([]string) (yaml.Node, bool)
	FindReference([]string) (yaml.Node, bool)
	FindInStubs([]string) (yaml.Node, bool)

	WithScope(step map[string]yaml.Node) Binding
	WithLocalScope(step map[string]yaml.Node) Binding
	WithPath(step string) Binding
	WithSource(source string) Binding
	WithNewRoot() Binding
	RedirectOverwrite(path []string) Binding

	Outer() Binding
	Path() []string
	StubPath() []string
	NoMerge() bool

	GetState() State
	GetTempName(data []byte) (string, error)
	GetFileContent(file string, cached bool) ([]byte, error)

	Flow(source yaml.Node, shouldOverride bool) (yaml.Node, Status)
	Cascade(outer Binding, template yaml.Node, partial bool, templates ...yaml.Node) (yaml.Node, error)
}

type BooleanExpr

type BooleanExpr struct {
	Value bool
}

func (BooleanExpr) Evaluate

func (e BooleanExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (BooleanExpr) String

func (e BooleanExpr) String() string

type Bytes added in v1.3.0

type Bytes interface {
	Bytes() []byte
}

type CallExpr

type CallExpr struct {
	Function  Expression
	Arguments []Expression
	Curry     bool
}

func (CallExpr) Evaluate

func (e CallExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (CallExpr) String

func (e CallExpr) String() string

type CatchExpr added in v1.3.0

type CatchExpr struct {
	A      Expression
	Lambda Expression
}

func (CatchExpr) Evaluate added in v1.3.0

func (e CatchExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (CatchExpr) String added in v1.3.0

func (e CatchExpr) String() string

type Cleanup added in v1.3.0

type Cleanup interface {
	Cleanup() error
}

type ComparisonExpr added in v1.2.0

type ComparisonExpr struct {
	A  Expression
	Op string
	B  Expression
}

func (ComparisonExpr) Evaluate added in v1.2.0

func (e ComparisonExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (ComparisonExpr) String added in v1.2.0

func (e ComparisonExpr) String() string

type ConcatenationExpr

type ConcatenationExpr struct {
	A Expression
	B Expression
}

func (ConcatenationExpr) Evaluate

func (e ConcatenationExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (ConcatenationExpr) String

func (e ConcatenationExpr) String() string

type CondExpr added in v1.2.0

type CondExpr struct {
	C Expression
	T Expression
	F Expression
}

func (CondExpr) Evaluate added in v1.2.0

func (e CondExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (CondExpr) String added in v1.2.0

func (e CondExpr) String() string

type CreateMapExpr added in v1.2.0

type CreateMapExpr struct {
	Assignments []Assignment
}

func (CreateMapExpr) Evaluate added in v1.2.0

func (e CreateMapExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (CreateMapExpr) String added in v1.2.0

func (e CreateMapExpr) String() string

type DefaultExpr added in v1.3.0

type DefaultExpr struct {
}

func (DefaultExpr) Evaluate added in v1.3.0

func (e DefaultExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (DefaultExpr) String added in v1.3.0

func (e DefaultExpr) String() string

type DivisionExpr added in v1.2.0

type DivisionExpr struct {
	A Expression
	B Expression
}

func (DivisionExpr) Evaluate added in v1.2.0

func (e DivisionExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (DivisionExpr) String added in v1.2.0

func (e DivisionExpr) String() string

type DynamicExpr added in v1.2.0

type DynamicExpr struct {
	Expression Expression
	Reference  Expression
}

func (DynamicExpr) Evaluate added in v1.2.0

func (e DynamicExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (DynamicExpr) String added in v1.2.0

func (e DynamicExpr) String() string

type DynamlGrammar

type DynamlGrammar struct {
	Buffer string

	Parse  func(rule ...int) error
	Reset  func()
	Pretty bool
	// contains filtered or unexported fields
}

func (*DynamlGrammar) Execute added in v1.2.0

func (p *DynamlGrammar) Execute()

func (*DynamlGrammar) Highlighter

func (p *DynamlGrammar) Highlighter()

func (*DynamlGrammar) Init

func (p *DynamlGrammar) Init()

func (*DynamlGrammar) PrintSyntaxTree

func (p *DynamlGrammar) PrintSyntaxTree()

type EvaluationError added in v1.3.0

type EvaluationError struct {
	EvaluationInfo
	// contains filtered or unexported fields
}

func (EvaluationError) Error added in v1.3.0

func (e EvaluationError) Error() string

type EvaluationInfo added in v1.2.0

type EvaluationInfo struct {
	RedirectPath []string
	Replace      bool
	Merged       bool
	Preferred    bool
	KeyName      string
	Source       string
	LocalError   bool
	Failed       bool
	Undefined    bool
	Raw          bool
	Issue        yaml.Issue
	Cleanups     []Cleanup
	yaml.NodeFlags
}

func DefaultInfo added in v1.2.0

func DefaultInfo() EvaluationInfo

func ParseData added in v1.3.0

func ParseData(file string, data []byte, mode string, binding Binding) (interface{}, EvaluationInfo, bool)

func ResolveExpressionListOrPushEvaluation added in v1.2.0

func ResolveExpressionListOrPushEvaluation(list *[]Expression, resolved *bool, info *EvaluationInfo, binding Binding, locally bool) ([]interface{}, EvaluationInfo, bool)

func ResolveExpressionOrPushEvaluation added in v1.2.0

func ResolveExpressionOrPushEvaluation(e *Expression, resolved *bool, info *EvaluationInfo, binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func ResolveIntegerExpressionOrPushEvaluation added in v1.2.0

func ResolveIntegerExpressionOrPushEvaluation(e *Expression, resolved *bool, info *EvaluationInfo, binding Binding, locally bool) (int64, EvaluationInfo, bool)

func (*EvaluationInfo) AnnotateError added in v1.3.0

func (i *EvaluationInfo) AnnotateError(err EvaluationInfo, msgfmt interface{}, args ...interface{}) (interface{}, EvaluationInfo, bool)

func (EvaluationInfo) CleanError added in v1.6.1

func (i EvaluationInfo) CleanError() EvaluationInfo

func (*EvaluationInfo) Cleanup added in v1.3.0

func (i *EvaluationInfo) Cleanup() error

func (*EvaluationInfo) DenyOSOperation added in v1.5.0

func (i *EvaluationInfo) DenyOSOperation(name string) (interface{}, EvaluationInfo, bool)

func (*EvaluationInfo) Error added in v1.2.0

func (i *EvaluationInfo) Error(msgfmt interface{}, args ...interface{}) (interface{}, EvaluationInfo, bool)

func (EvaluationInfo) Join added in v1.2.0

func (*EvaluationInfo) PropagateError added in v1.2.0

func (i *EvaluationInfo) PropagateError(value interface{}, state Status, msgfmt string, args ...interface{}) (interface{}, EvaluationInfo, bool)

func (*EvaluationInfo) SetError added in v1.2.0

func (i *EvaluationInfo) SetError(msgfmt interface{}, args ...interface{})

func (EvaluationInfo) SourceName added in v1.2.0

func (e EvaluationInfo) SourceName() string

type Expander added in v1.3.0

type Expander func(dst []byte, src []byte, match []int) (bool, []byte, error)

func LambdaExpander added in v1.3.0

func LambdaExpander(lambda LambdaValue, binding Binding) Expander

func RegExpExpander added in v1.3.0

func RegExpExpander(exp *regexp.Regexp, templ []byte) Expander

type Expression

type Expression interface {
	Evaluate(Binding, bool) (interface{}, EvaluationInfo, bool)
}

func KeepArgWrapper added in v1.4.0

func KeepArgWrapper(e Expression, orig Expression) Expression

func Parse

func Parse(source string, path []string, stubPath []string) (Expression, error)

type ExpressionParseError added in v1.3.0

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

func NewParseError added in v1.3.0

func NewParseError(grammar *DynamlGrammar, token token32, msg error) *ExpressionParseError

func (ExpressionParseError) Error added in v1.3.0

func (e ExpressionParseError) Error() string

func (ExpressionParseError) String added in v1.3.0

func (e ExpressionParseError) String() string

type FileEntry added in v1.3.0

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

type Finder added in v1.3.0

type Finder func(src []byte) []int

func RegExpFinder added in v1.3.0

func RegExpFinder(exp *regexp.Regexp) Finder

func StringFinder added in v1.3.0

func StringFinder(str string) Finder

type FloatExpr added in v1.6.0

type FloatExpr struct {
	Value float64
}

func (FloatExpr) Evaluate added in v1.6.0

func (e FloatExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (FloatExpr) String added in v1.6.0

func (e FloatExpr) String() string

type Function added in v1.2.0

type Function func(arguments []interface{}, binding Binding) (interface{}, EvaluationInfo, bool)

type GroupedExpr added in v1.3.0

type GroupedExpr struct {
	Expr Expression
}

func (GroupedExpr) Evaluate added in v1.3.0

func (e GroupedExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (GroupedExpr) String added in v1.3.0

func (e GroupedExpr) String() string

type IPRange added in v1.2.0

type IPRange interface {
	GetSize() int64
	GetIP(int64) net.IP
}

type IntegerExpr

type IntegerExpr struct {
	Value int64
}

func (IntegerExpr) Evaluate

func (e IntegerExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (IntegerExpr) String

func (e IntegerExpr) String() string

type LambdaExpr added in v1.2.0

type LambdaExpr struct {
	Parameters []Parameter
	VarArgs    bool
	E          Expression
}

func (LambdaExpr) Evaluate added in v1.2.0

func (e LambdaExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (LambdaExpr) String added in v1.2.0

func (e LambdaExpr) String() string

type LambdaRefExpr added in v1.2.0

type LambdaRefExpr struct {
	Source   Expression
	Path     []string
	StubPath []string
}

func (LambdaRefExpr) Evaluate added in v1.2.0

func (e LambdaRefExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (LambdaRefExpr) String added in v1.2.0

func (e LambdaRefExpr) String() string

type LambdaValue added in v1.2.0

type LambdaValue struct {
	Parameters []Parameter
	// contains filtered or unexported fields
}

func (LambdaValue) EquivalentTo added in v1.3.0

func (e LambdaValue) EquivalentTo(val interface{}) bool

func (LambdaValue) Evaluate added in v1.2.0

func (e LambdaValue) Evaluate(inline bool, curry, autocurry bool, nargs map[string]yaml.Node, args []interface{}, binding Binding, locally bool) (bool, interface{}, EvaluationInfo, bool)

func (LambdaValue) MarshalYAML added in v1.2.0

func (e LambdaValue) MarshalYAML() (tag string, value interface{}, err error)

func (LambdaValue) NumOptional added in v1.4.0

func (e LambdaValue) NumOptional() int

func (LambdaValue) ParameterIndex added in v1.4.0

func (e LambdaValue) ParameterIndex(name string) int

func (LambdaValue) SetStaticResolver added in v1.3.0

func (e LambdaValue) SetStaticResolver(binding Binding) StaticallyScopedValue

func (LambdaValue) StaticResolver added in v1.3.0

func (e LambdaValue) StaticResolver() Binding

func (LambdaValue) String added in v1.2.0

func (e LambdaValue) String() string

type Less added in v1.3.0

type Less func(i, j int) bool

func LambdaLess added in v1.3.0

func LambdaLess(lambda LambdaValue, list []yaml.Node, binding Binding) Less

func ValueLess added in v1.3.0

func ValueLess(list []yaml.Node) Less

type ListExpansion added in v1.4.0

type ListExpansion interface {
	Expression
	IsListExpansion() bool
}

type ListExpansionExpr added in v1.4.0

type ListExpansionExpr struct {
	Expression
}

func (ListExpansionExpr) Evaluate added in v1.4.0

func (e ListExpansionExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (ListExpansionExpr) IsListExpansion added in v1.4.0

func (e ListExpansionExpr) IsListExpansion() bool

func (ListExpansionExpr) String added in v1.4.0

func (e ListExpansionExpr) String() string

type ListExpr

type ListExpr struct {
	Contents []Expression
}

func (ListExpr) Evaluate

func (e ListExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (ListExpr) String

func (e ListExpr) String() string

type LogAndExpr added in v1.2.0

type LogAndExpr struct {
	A Expression
	B Expression
}

func (LogAndExpr) Evaluate added in v1.2.0

func (e LogAndExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (LogAndExpr) String added in v1.2.0

func (e LogAndExpr) String() string

type LogOrExpr added in v1.2.0

type LogOrExpr struct {
	A Expression
	B Expression
}

func (LogOrExpr) Evaluate added in v1.2.0

func (e LogOrExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (LogOrExpr) String added in v1.2.0

func (e LogOrExpr) String() string

type Mapper added in v1.6.1

type Mapper func(inline bool, value interface{}, e LambdaValue, binding Binding, aggr MappingAggregation) (interface{}, EvaluationInfo, bool)

func MapperForSource added in v1.6.1

func MapperForSource(value interface{}) Mapper

type MappingAggregation added in v1.3.0

type MappingAggregation interface {
	DoMapping(inline bool, value interface{}, e LambdaValue, binding Binding) (interface{}, EvaluationInfo, bool)
	Add(key interface{}, value interface{}, n yaml.Node, info EvaluationInfo) error
	Result() interface{}
}

type MappingContext added in v1.3.0

type MappingContext interface {
	CreateMappingAggregation(source interface{}) MappingAggregation
	Keyword() string
	Brackets() string
	Supports(source interface{}) bool
}

type MappingExpr added in v1.3.0

type MappingExpr struct {
	A       Expression
	Lambda  Expression
	Context MappingContext
}

func (MappingExpr) Evaluate added in v1.3.0

func (e MappingExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (MappingExpr) String added in v1.3.0

func (e MappingExpr) String() string

type MarkerExpr added in v1.2.0

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

func (MarkerExpr) Evaluate added in v1.2.0

func (e MarkerExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (MarkerExpr) GetFlags added in v1.2.0

func (e MarkerExpr) GetFlags() yaml.NodeFlags

func (MarkerExpr) Has added in v1.2.0

func (e MarkerExpr) Has(t string) bool

func (MarkerExpr) MarshalYAML added in v1.2.0

func (e MarkerExpr) MarshalYAML() (tag string, value interface{}, err error)

func (MarkerExpr) String added in v1.2.0

func (e MarkerExpr) String() string

func (MarkerExpr) TemplateExpression added in v1.2.0

func (e MarkerExpr) TemplateExpression(orig yaml.Node) yaml.Node

type MarkerExpressionExpr added in v1.2.0

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

func (MarkerExpressionExpr) Evaluate added in v1.2.0

func (e MarkerExpressionExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (MarkerExpressionExpr) String added in v1.2.0

func (e MarkerExpressionExpr) String() string

type MergeExpr

type MergeExpr struct {
	Path     []string
	Redirect bool
	Replace  bool
	Required bool
	None     bool
	KeyName  string
}

func (MergeExpr) Evaluate

func (e MergeExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (MergeExpr) String

func (e MergeExpr) String() string

type ModuloExpr added in v1.2.0

type ModuloExpr struct {
	A Expression
	B Expression
}

func (ModuloExpr) Evaluate added in v1.2.0

func (e ModuloExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (ModuloExpr) String added in v1.2.0

func (e ModuloExpr) String() string

type MultiplicationExpr added in v1.2.0

type MultiplicationExpr struct {
	A Expression
	B Expression
}

func (MultiplicationExpr) Evaluate added in v1.2.0

func (e MultiplicationExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (MultiplicationExpr) String added in v1.2.0

func (e MultiplicationExpr) String() string

type NameArgument added in v1.4.0

type NameArgument struct {
	Name string
	Expression
}

func (NameArgument) String added in v1.4.0

func (a NameArgument) String() string

type NilExpr

type NilExpr struct{}

func (NilExpr) Evaluate

func (e NilExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (NilExpr) String

func (e NilExpr) String() string

type NotExpr added in v1.2.0

type NotExpr struct {
	Expr Expression
}

func (NotExpr) Evaluate added in v1.2.0

func (e NotExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (NotExpr) String added in v1.2.0

func (e NotExpr) String() string

type OrExpr

type OrExpr struct {
	A Expression
	B Expression
}

func (OrExpr) Evaluate

func (e OrExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (OrExpr) String

func (e OrExpr) String() string

type Parameter added in v1.4.0

type Parameter struct {
	Name    string
	Default Expression
}

func (Parameter) String added in v1.4.0

func (p Parameter) String() string

type PreferExpr added in v1.2.0

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

func (PreferExpr) Evaluate added in v1.2.0

func (e PreferExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (PreferExpr) String added in v1.2.0

func (e PreferExpr) String() string

type ProjectionExpr added in v1.2.0

type ProjectionExpr struct {
	Expression Expression
	Value      *ProjectionValue
	Projection Expression
}

func (ProjectionExpr) Evaluate added in v1.2.0

func (e ProjectionExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (ProjectionExpr) String added in v1.2.0

func (e ProjectionExpr) String() string

type ProjectionValue added in v1.2.0

type ProjectionValue struct {
	Value interface{}
}

type ProjectionValueExpr added in v1.2.0

type ProjectionValueExpr struct {
	Value *ProjectionValue
}

func (ProjectionValueExpr) Evaluate added in v1.2.0

func (e ProjectionValueExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (ProjectionValueExpr) String added in v1.2.0

func (e ProjectionValueExpr) String() string

type QualifiedExpr added in v1.2.0

type QualifiedExpr struct {
	Expression Expression
	Reference  ReferenceExpr
}

func (QualifiedExpr) Evaluate added in v1.2.0

func (e QualifiedExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (QualifiedExpr) String added in v1.2.0

func (e QualifiedExpr) String() string

type RangeExpr added in v1.2.0

type RangeExpr struct {
	Start Expression
	End   Expression
}

func (RangeExpr) Evaluate added in v1.2.0

func (e RangeExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (RangeExpr) String added in v1.2.0

func (e RangeExpr) String() string

type ReferenceExpr

type ReferenceExpr struct {
	Path []string
}

func (ReferenceExpr) Evaluate

func (e ReferenceExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (ReferenceExpr) String

func (e ReferenceExpr) String() string

type Registry added in v1.6.0

type Registry interface {
	RegisterFunction(name string, f Function)
	LookupFunction(name string) Function
}

func NewRegistry added in v1.6.0

func NewRegistry() Registry

type ScopeExpr added in v1.3.0

type ScopeExpr struct {
	CreateMapExpr
	E Expression
}

func (ScopeExpr) Evaluate added in v1.3.0

func (e ScopeExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (ScopeExpr) String added in v1.3.0

func (e ScopeExpr) String() string

type SliceExpr added in v1.2.0

type SliceExpr struct {
	Expression Expression
	Range      RangeExpr
}

func (SliceExpr) Evaluate added in v1.2.0

func (e SliceExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (SliceExpr) String added in v1.2.0

func (e SliceExpr) String() string

type SourceProvider added in v1.2.0

type SourceProvider interface {
	SourceName() string
}

type State added in v1.3.0

type State interface {
	GetTempName(data []byte) (string, error)
	GetFileContent(file string, cached bool) ([]byte, error)
	GetEncryptionKey() string
	OSAccessAllowed() bool
	FileAccessAllowed() bool
	FileSystem() vfs.VFS
	GetFunctions() Registry
}

type StaticallyScopedValue added in v1.3.0

type StaticallyScopedValue interface {
	StaticResolver() Binding
	SetStaticResolver(binding Binding) StaticallyScopedValue
}

type Status added in v1.2.0

type Status interface {
	error
	Issue(fmt string, args ...interface{}) (issue yaml.Issue, localError bool, failed bool)
	HasError() bool
}

type StringExpr

type StringExpr struct {
	Value string
}

func (StringExpr) Evaluate

func (e StringExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (StringExpr) String

func (e StringExpr) String() string

type SubstitutionExpr added in v1.2.0

type SubstitutionExpr struct {
	Template Expression
}

func (SubstitutionExpr) Evaluate added in v1.2.0

func (e SubstitutionExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (SubstitutionExpr) String added in v1.2.0

func (e SubstitutionExpr) String() string

type SubtractionExpr

type SubtractionExpr struct {
	A Expression
	B Expression
}

func (SubtractionExpr) Evaluate

func (e SubtractionExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (SubtractionExpr) String

func (e SubtractionExpr) String() string

type SumExpr added in v1.2.0

type SumExpr struct {
	A      Expression
	I      Expression
	Lambda Expression
}

func (SumExpr) Evaluate added in v1.2.0

func (e SumExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (SumExpr) String added in v1.2.0

func (e SumExpr) String() string

type SyncExpr added in v1.3.0

type SyncExpr struct {
	A       Expression
	Cond    Expression
	Value   Expression
	Timeout Expression
	// contains filtered or unexported fields
}

func (SyncExpr) Evaluate added in v1.3.0

func (e SyncExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (SyncExpr) String added in v1.3.0

func (e SyncExpr) String() string

type TemplateValue added in v1.2.0

type TemplateValue struct {
	Path     []string
	Prepared yaml.Node
	Orig     yaml.Node
	// contains filtered or unexported fields
}

func NewTemplateValue added in v1.3.0

func NewTemplateValue(path []string, prepared yaml.Node, orig yaml.Node, binding Binding) TemplateValue

func (TemplateValue) EquivalentTo added in v1.3.0

func (e TemplateValue) EquivalentTo(val interface{}) bool

func (TemplateValue) MarshalYAML added in v1.2.0

func (e TemplateValue) MarshalYAML() (tag string, value interface{}, err error)

func (TemplateValue) SetStaticResolver added in v1.3.0

func (e TemplateValue) SetStaticResolver(binding Binding) StaticallyScopedValue

func (TemplateValue) StaticResolver added in v1.3.0

func (e TemplateValue) StaticResolver() Binding

func (TemplateValue) String added in v1.3.0

func (e TemplateValue) String() string

type UndefinedExpr added in v1.2.0

type UndefinedExpr struct{}

func (UndefinedExpr) Evaluate added in v1.2.0

func (e UndefinedExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (UndefinedExpr) String added in v1.2.0

func (e UndefinedExpr) String() string

type UnresolvedNode added in v1.2.0

type UnresolvedNode struct {
	yaml.Node

	Context []string
	Path    []string
}

func FindUnresolvedNodes added in v1.2.0

func FindUnresolvedNodes(root yaml.Node, context ...string) (result []UnresolvedNode)

type UnresolvedNodes added in v1.2.0

type UnresolvedNodes struct {
	Nodes []UnresolvedNode
}

func (UnresolvedNodes) Error added in v1.2.0

func (e UnresolvedNodes) Error() string

func (UnresolvedNodes) HasError added in v1.2.0

func (e UnresolvedNodes) HasError() bool

func (UnresolvedNodes) Issue added in v1.2.0

func (e UnresolvedNodes) Issue(msgfmt string, args ...interface{}) (result yaml.Issue, localError bool, failed bool)

type ValidOrExpr added in v1.3.0

type ValidOrExpr struct {
	A Expression
	B Expression
}

func (ValidOrExpr) Evaluate added in v1.3.0

func (e ValidOrExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (ValidOrExpr) String added in v1.3.0

func (e ValidOrExpr) String() string

type Validator added in v1.3.0

type Validator func(value interface{}, binding Binding, args ...interface{}) (bool, string, error, bool)

type ValueExpr added in v1.4.0

type ValueExpr struct {
	Value interface{}
}

func (ValueExpr) Evaluate added in v1.4.0

func (e ValueExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool)

func (ValueExpr) String added in v1.4.0

func (e ValueExpr) String() string

type WriteOpts added in v1.6.1

type WriteOpts struct {
	Binary      bool
	Multi       bool
	Permissions int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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