dynaml

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 36 Imported by: 0

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 MaxInt = int64(MaxUint >> 1)
View Source
const MaxUint = ^uint64(0)
View Source
const (
	OpAnd = "-and"
)
View Source
const (
	OpOr = "-or"
)

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

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

func CatchEvaluationError

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

func DiffIP

func DiffIP(a, b net.IP) int64

func EmptyError

func EmptyError() string

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

func ExpressionType

func ExpressionType(elem interface{}) string

func IPAdd

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

func IsDNS1035Label

func IsDNS1035Label(value string) []string

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

func IsDNS1123Label

func IsDNS1123Label(value string) []string

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

func IsDNS1123Subdomain

func IsDNS1123Subdomain(value string) []string

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

func IsListExpansion

func IsListExpansion(e Expression) bool

func IsWildcardDNS1123Subdomain

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

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

func MaxIP

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

func MaxLenError

func MaxLenError(length int) string

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

func NewNode

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

func PathComponents

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

func RaiseEvaluationError

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

func RaiseEvaluationErrorf

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

func RegexError

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

RegexError returns a string explanation of a regex validation failure.

func RegisterFunction

func RegisterFunction(name string, f Function)

func RegisterValidator

func RegisterValidator(name string, f Validator)

func ReloadEnv

func ReloadEnv()

func ReplaceRegExp

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

func ReplaceString

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

func ResetUnresolvedNodes

func ResetUnresolvedNodes(root yaml.Node) yaml.Node

func SimpleValidatorResult

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

func StringValue

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

func SubIP

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

func ValidatorErrorf

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

func ValidatorResult

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

func ValueAsString

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

type Assignment struct {
	Key   Expression
	Value Expression
}

func (Assignment) String

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

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

type CatchExpr struct {
	A      Expression
	Lambda Expression
}

func (CatchExpr) Evaluate

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

func (CatchExpr) String

func (e CatchExpr) String() string

type Cleanup

type Cleanup interface {
	Cleanup() error
}

type ComparisonExpr

type ComparisonExpr struct {
	A  Expression
	Op string
	B  Expression
}

func (ComparisonExpr) Evaluate

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

func (ComparisonExpr) String

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

type CondExpr struct {
	C Expression
	T Expression
	F Expression
}

func (CondExpr) Evaluate

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

func (CondExpr) String

func (e CondExpr) String() string

type CreateMapExpr

type CreateMapExpr struct {
	Assignments []Assignment
}

func (CreateMapExpr) Evaluate

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

func (CreateMapExpr) String

func (e CreateMapExpr) String() string

type DefaultExpr

type DefaultExpr struct {
}

func (DefaultExpr) Evaluate

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

func (DefaultExpr) String

func (e DefaultExpr) String() string

type DivisionExpr

type DivisionExpr struct {
	A Expression
	B Expression
}

func (DivisionExpr) Evaluate

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

func (DivisionExpr) String

func (e DivisionExpr) String() string

type DynamicExpr

type DynamicExpr struct {
	Expression Expression
	Reference  Expression
}

func (DynamicExpr) Evaluate

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

func (DynamicExpr) String

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

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

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

func (EvaluationError) Error

func (e EvaluationError) Error() string

type EvaluationInfo

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

func DefaultInfo() EvaluationInfo

func ParseData

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

func ResolveExpressionListOrPushEvaluation

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

func ResolveExpressionOrPushEvaluation

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

func ResolveIntegerExpressionOrPushEvaluation

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

func (*EvaluationInfo) AnnotateError

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

func (*EvaluationInfo) Cleanup

func (i *EvaluationInfo) Cleanup() error

func (*EvaluationInfo) Error

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

func (EvaluationInfo) Join

func (*EvaluationInfo) PropagateError

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

func (*EvaluationInfo) SetError

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

func (EvaluationInfo) SourceName

func (e EvaluationInfo) SourceName() string

type Expander

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

func LambdaExpander

func LambdaExpander(lambda LambdaValue, binding Binding) Expander

func RegExpExpander

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

type Expression

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

func KeepArgWrapper

func KeepArgWrapper(e Expression, orig Expression) Expression

func Parse

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

type ExpressionParseError

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

func NewParseError

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

func (ExpressionParseError) Error

func (e ExpressionParseError) Error() string

func (ExpressionParseError) String

func (e ExpressionParseError) String() string

type FileEntry

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

type Finder

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

func RegExpFinder

func RegExpFinder(exp *regexp.Regexp) Finder

func StringFinder

func StringFinder(str string) Finder

type Function

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

type GroupedExpr

type GroupedExpr struct {
	Expr Expression
}

func (GroupedExpr) Evaluate

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

func (GroupedExpr) String

func (e GroupedExpr) String() string

type IPRange

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

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

func (LambdaExpr) Evaluate

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

func (LambdaExpr) String

func (e LambdaExpr) String() string

type LambdaRefExpr

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

func (LambdaRefExpr) Evaluate

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

func (LambdaRefExpr) String

func (e LambdaRefExpr) String() string

type LambdaValue

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

func (LambdaValue) EquivalentTo

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

func (LambdaValue) Evaluate

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

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

func (LambdaValue) NumOptional

func (e LambdaValue) NumOptional() int

func (LambdaValue) ParameterIndex

func (e LambdaValue) ParameterIndex(name string) int

func (LambdaValue) SetStaticResolver

func (e LambdaValue) SetStaticResolver(binding Binding) StaticallyScopedValue

func (LambdaValue) StaticResolver

func (e LambdaValue) StaticResolver() Binding

func (LambdaValue) String

func (e LambdaValue) String() string

type Less

type Less func(i, j int) bool

func LambdaLess

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

func ValueLess

func ValueLess(list []yaml.Node) Less

type ListExpansion

type ListExpansion interface {
	Expression
	IsListExpansion() bool
}

type ListExpansionExpr

type ListExpansionExpr struct {
	Expression
}

func (ListExpansionExpr) Evaluate

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

func (ListExpansionExpr) IsListExpansion

func (e ListExpansionExpr) IsListExpansion() bool

func (ListExpansionExpr) String

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

type LogAndExpr struct {
	A Expression
	B Expression
}

func (LogAndExpr) Evaluate

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

func (LogAndExpr) String

func (e LogAndExpr) String() string

type LogOrExpr

type LogOrExpr struct {
	A Expression
	B Expression
}

func (LogOrExpr) Evaluate

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

func (LogOrExpr) String

func (e LogOrExpr) String() string

type MappingAggregation

type MappingAggregation interface {
	Map(key interface{}, value interface{}, n yaml.Node, info EvaluationInfo)
	Result() interface{}
}

type MappingContext

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

type MappingExpr

type MappingExpr struct {
	A       Expression
	Lambda  Expression
	Context MappingContext
}

func (MappingExpr) Evaluate

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

func (MappingExpr) String

func (e MappingExpr) String() string

type MarkerExpr

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

func (MarkerExpr) Evaluate

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

func (MarkerExpr) GetFlags

func (e MarkerExpr) GetFlags() yaml.NodeFlags

func (MarkerExpr) Has

func (e MarkerExpr) Has(t string) bool

func (MarkerExpr) MarshalYAML

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

func (MarkerExpr) String

func (e MarkerExpr) String() string

func (MarkerExpr) TemplateExpression

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

type MarkerExpressionExpr

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

func (MarkerExpressionExpr) Evaluate

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

func (MarkerExpressionExpr) String

func (e MarkerExpressionExpr) String() string

type MergeExpr

type MergeExpr struct {
	Path     []string
	Redirect bool
	Replace  bool
	Required 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

type ModuloExpr struct {
	A Expression
	B Expression
}

func (ModuloExpr) Evaluate

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

func (ModuloExpr) String

func (e ModuloExpr) String() string

type MultiplicationExpr

type MultiplicationExpr struct {
	A Expression
	B Expression
}

func (MultiplicationExpr) Evaluate

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

func (MultiplicationExpr) String

func (e MultiplicationExpr) String() string

type NameArgument

type NameArgument struct {
	Name string
	Expression
}

func (NameArgument) String

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

type NotExpr struct {
	Expr Expression
}

func (NotExpr) Evaluate

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

func (NotExpr) String

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

type Parameter struct {
	Name    string
	Default Expression
}

func (Parameter) String

func (p Parameter) String() string

type PreferExpr

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

func (PreferExpr) Evaluate

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

func (PreferExpr) String

func (e PreferExpr) String() string

type ProjectionExpr

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

func (ProjectionExpr) Evaluate

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

func (ProjectionExpr) String

func (e ProjectionExpr) String() string

type ProjectionValue

type ProjectionValue struct {
	Value interface{}
}

type ProjectionValueExpr

type ProjectionValueExpr struct {
	Value *ProjectionValue
}

func (ProjectionValueExpr) Evaluate

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

func (ProjectionValueExpr) String

func (e ProjectionValueExpr) String() string

type QualifiedExpr

type QualifiedExpr struct {
	Expression Expression
	Reference  ReferenceExpr
}

func (QualifiedExpr) Evaluate

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

func (QualifiedExpr) String

func (e QualifiedExpr) String() string

type RangeExpr

type RangeExpr struct {
	Start Expression
	End   Expression
}

func (RangeExpr) Evaluate

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

func (RangeExpr) String

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 ScopeExpr

type ScopeExpr struct {
	CreateMapExpr
	E Expression
}

func (ScopeExpr) Evaluate

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

func (ScopeExpr) String

func (e ScopeExpr) String() string

type SliceExpr

type SliceExpr struct {
	Expression Expression
	Range      RangeExpr
}

func (SliceExpr) Evaluate

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

func (SliceExpr) String

func (e SliceExpr) String() string

type SourceProvider

type SourceProvider interface {
	SourceName() string
}

type State

type State interface {
	GetTempName(data []byte) (string, error)
	GetFileContent(file string, cached bool) ([]byte, error)
	GetEncryptionKey() string
}

type StaticallyScopedValue

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

type Status

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

type SubstitutionExpr struct {
	Template Expression
}

func (SubstitutionExpr) Evaluate

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

func (SubstitutionExpr) String

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

type SumExpr struct {
	A      Expression
	I      Expression
	Lambda Expression
}

func (SumExpr) Evaluate

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

func (SumExpr) String

func (e SumExpr) String() string

type SyncExpr

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

func (SyncExpr) Evaluate

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

func (SyncExpr) String

func (e SyncExpr) String() string

type TemplateValue

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

func NewTemplateValue

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

func (TemplateValue) EquivalentTo

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

func (TemplateValue) MarshalYAML

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

func (TemplateValue) SetStaticResolver

func (e TemplateValue) SetStaticResolver(binding Binding) StaticallyScopedValue

func (TemplateValue) StaticResolver

func (e TemplateValue) StaticResolver() Binding

func (TemplateValue) String

func (e TemplateValue) String() string

type UndefinedExpr

type UndefinedExpr struct{}

func (UndefinedExpr) Evaluate

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

func (UndefinedExpr) String

func (e UndefinedExpr) String() string

type UnresolvedNode

type UnresolvedNode struct {
	yaml.Node

	Context []string
	Path    []string
}

func FindUnresolvedNodes

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

type UnresolvedNodes

type UnresolvedNodes struct {
	Nodes []UnresolvedNode
}

func (UnresolvedNodes) Error

func (e UnresolvedNodes) Error() string

func (UnresolvedNodes) HasError

func (e UnresolvedNodes) HasError() bool

func (UnresolvedNodes) Issue

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

type ValidOrExpr

type ValidOrExpr struct {
	A Expression
	B Expression
}

func (ValidOrExpr) Evaluate

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

func (ValidOrExpr) String

func (e ValidOrExpr) String() string

type Validator

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

type ValueExpr

type ValueExpr struct {
	Value interface{}
}

func (ValueExpr) Evaluate

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

func (ValueExpr) String

func (e ValueExpr) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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