evaluator

package
Version: v0.0.0-...-5253b6b Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IL

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

IL is an implementation of expr.Evaluator that also exposes specific methods. Specifically, it can listen to config change events.

func NewILEvaluator

func NewILEvaluator(cacheSize int, maxStringTableSizeForPurge int) (*IL, error)

NewILEvaluator returns a new instance of IL.

func (*IL) AssertType

func (e *IL) AssertType(expr string, finder expr.AttributeDescriptorFinder, expectedType pb.ValueType) error

AssertType evaluates the type of expr using the attribute set; if the evaluated type is equal to the expected type we return nil, and return an error otherwise.

func (*IL) ChangeVocabulary

func (e *IL) ChangeVocabulary(finder expr.AttributeDescriptorFinder)

ChangeVocabulary handles changing of the attribute vocabulary.

func (*IL) ConfigChange

func (e *IL) ConfigChange(cfg config.Resolver, df descriptor.Finder, handlers map[string]*config.HandlerInfo)

ConfigChange handles changing of configuration.

func (*IL) Eval

func (e *IL) Eval(expr string, attrs attribute.Bag) (interface{}, error)

Eval evaluates expr using the attr attribute bag and returns the result as interface{}.

func (*IL) EvalPredicate

func (e *IL) EvalPredicate(expr string, attrs attribute.Bag) (bool, error)

EvalPredicate evaluates expr using the attr attribute bag and returns the result as bool.

func (*IL) EvalString

func (e *IL) EvalString(expr string, attrs attribute.Bag) (string, error)

EvalString evaluates expr using the attr attribute bag and returns the result as string.

func (*IL) EvalType

func (e *IL) EvalType(expr string, finder expr.AttributeDescriptorFinder) (pb.ValueType, error)

EvalType evaluates expr using the attr attribute bag and returns the type of the result.

Source Files

Jump to

Keyboard shortcuts

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