stateful

package
v0.0.0-...-298395c Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFloat = errors.New("value is not a float")

Functions

This section is empty.

Types

type Domain

type Domain [maxArgs]ast.ValueType

func (Domain) String

func (d Domain) String() string

type Domains

type Domains []Domain

func FuncDomains

func FuncDomains(f Func) Domains

func (Domains) String

func (ds Domains) String() string

type DynamicFunc

type DynamicFunc struct {
	F   func(args ...interface{}) (interface{}, error)
	Sig map[Domain]ast.ValueType
}

func (DynamicFunc) Call

func (df DynamicFunc) Call(args ...interface{}) (interface{}, error)

func (DynamicFunc) Reset

func (df DynamicFunc) Reset()

func (DynamicFunc) Signature

func (df DynamicFunc) Signature() map[Domain]ast.ValueType

type DynamicMethod

type DynamicMethod func(self interface{}, args ...interface{}) (interface{}, error)

type ErrMissingType

type ErrMissingType struct {
	Name  string
	Args  []string
	Scope []string
}

func (ErrMissingType) Error

func (e ErrMissingType) Error() string

type ErrSide

type ErrSide struct {
	IsLeft  bool
	IsRight bool
	// contains filtered or unexported fields
}

ErrSide wraps the error in the evaluation, we use this error to indicate the origin of the error left side or right side

type ErrTypeGuardFailed

type ErrTypeGuardFailed struct {
	RequestedType ast.ValueType
	ActualType    ast.ValueType
}

ErrTypeGuardFailed is returned when a speicifc value type is requested thorugh NodeEvaluator (for example: "Float64Value") when the node doesn't support the given type, for example "Float64Value" is called on BoolNode

func (ErrTypeGuardFailed) Error

func (e ErrTypeGuardFailed) Error() string

type ErrWrongFuncSignature

type ErrWrongFuncSignature struct {
	Name           string
	DomainProvided Domain
	ArgLiterals    []string
	Func           Func
}

func (ErrWrongFuncSignature) Error

func (e ErrWrongFuncSignature) Error() string

type EvalBinaryNode

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

EvalBinaryNode is stateful expression which

is evaluated using "expression trees" instead of stack based interpreter

func NewEvalBinaryNode

func NewEvalBinaryNode(node *ast.BinaryNode) (*EvalBinaryNode, error)

func (*EvalBinaryNode) EvalBool

func (e *EvalBinaryNode) EvalBool(scope *Scope, executionState ExecutionState) (bool, error)

EvalBool executes the expression based on eval bool

func (*EvalBinaryNode) EvalDuration

func (e *EvalBinaryNode) EvalDuration(scope *Scope, executionState ExecutionState) (time.Duration, error)

func (*EvalBinaryNode) EvalFloat

func (e *EvalBinaryNode) EvalFloat(scope *Scope, executionState ExecutionState) (float64, error)

EvalNum executes the expression based on eval numeric

func (*EvalBinaryNode) EvalInt

func (e *EvalBinaryNode) EvalInt(scope *Scope, executionState ExecutionState) (int64, error)

func (*EvalBinaryNode) EvalMissing

func (n *EvalBinaryNode) EvalMissing(scope *Scope, executionState ExecutionState) (*ast.Missing, error)

func (*EvalBinaryNode) EvalRegex

func (n *EvalBinaryNode) EvalRegex(scope *Scope, executionState ExecutionState) (*regexp.Regexp, error)

func (*EvalBinaryNode) EvalString

func (e *EvalBinaryNode) EvalString(scope *Scope, executionState ExecutionState) (string, error)

func (*EvalBinaryNode) EvalTime

func (n *EvalBinaryNode) EvalTime(scope *Scope, executionState ExecutionState) (time.Time, error)

func (*EvalBinaryNode) IsDynamic

func (n *EvalBinaryNode) IsDynamic() bool

func (*EvalBinaryNode) String

func (n *EvalBinaryNode) String() string

func (*EvalBinaryNode) Type

func (n *EvalBinaryNode) Type(scope ReadOnlyScope) (ast.ValueType, error)

type EvalBoolNode

type EvalBoolNode struct {
	Node *ast.BoolNode
}

func (*EvalBoolNode) EvalBool

func (n *EvalBoolNode) EvalBool(scope *Scope, executionState ExecutionState) (bool, error)

func (*EvalBoolNode) EvalDuration

func (n *EvalBoolNode) EvalDuration(scope *Scope, executionState ExecutionState) (time.Duration, error)

func (*EvalBoolNode) EvalFloat

func (n *EvalBoolNode) EvalFloat(scope *Scope, executionState ExecutionState) (float64, error)

func (*EvalBoolNode) EvalInt

func (n *EvalBoolNode) EvalInt(scope *Scope, executionState ExecutionState) (int64, error)

func (*EvalBoolNode) EvalMissing

func (n *EvalBoolNode) EvalMissing(scope *Scope, executionState ExecutionState) (*ast.Missing, error)

func (*EvalBoolNode) EvalRegex

func (n *EvalBoolNode) EvalRegex(scope *Scope, executionState ExecutionState) (*regexp.Regexp, error)

func (*EvalBoolNode) EvalString

func (n *EvalBoolNode) EvalString(scope *Scope, executionState ExecutionState) (string, error)

func (*EvalBoolNode) EvalTime

func (n *EvalBoolNode) EvalTime(scope *Scope, executionState ExecutionState) (time.Time, error)

func (*EvalBoolNode) IsDynamic

func (n *EvalBoolNode) IsDynamic() bool

func (*EvalBoolNode) String

func (n *EvalBoolNode) String() string

func (*EvalBoolNode) Type

func (n *EvalBoolNode) Type(scope ReadOnlyScope) (ast.ValueType, error)

type EvalDurationNode

type EvalDurationNode struct {
	Duration time.Duration
}

func (*EvalDurationNode) EvalBool

func (n *EvalDurationNode) EvalBool(scope *Scope, executionState ExecutionState) (bool, error)

func (*EvalDurationNode) EvalDuration

func (n *EvalDurationNode) EvalDuration(scope *Scope, executionState ExecutionState) (time.Duration, error)

func (*EvalDurationNode) EvalFloat

func (n *EvalDurationNode) EvalFloat(scope *Scope, executionState ExecutionState) (float64, error)

func (*EvalDurationNode) EvalInt

func (n *EvalDurationNode) EvalInt(scope *Scope, executionState ExecutionState) (int64, error)

func (*EvalDurationNode) EvalMissing

func (n *EvalDurationNode) EvalMissing(scope *Scope, executionState ExecutionState) (*ast.Missing, error)

func (*EvalDurationNode) EvalRegex

func (n *EvalDurationNode) EvalRegex(scope *Scope, executionState ExecutionState) (*regexp.Regexp, error)

func (*EvalDurationNode) EvalString

func (n *EvalDurationNode) EvalString(scope *Scope, executionState ExecutionState) (string, error)

func (*EvalDurationNode) EvalTime

func (n *EvalDurationNode) EvalTime(scope *Scope, executionState ExecutionState) (time.Time, error)

func (*EvalDurationNode) IsDynamic

func (n *EvalDurationNode) IsDynamic() bool

func (*EvalDurationNode) String

func (n *EvalDurationNode) String() string

func (*EvalDurationNode) Type

func (n *EvalDurationNode) Type(scope ReadOnlyScope) (ast.ValueType, error)

type EvalFloatNode

type EvalFloatNode struct {
	Float64 float64
}

func (*EvalFloatNode) EvalBool

func (n *EvalFloatNode) EvalBool(scope *Scope, executionState ExecutionState) (bool, error)

func (*EvalFloatNode) EvalDuration

func (n *EvalFloatNode) EvalDuration(scope *Scope, executionState ExecutionState) (time.Duration, error)

func (*EvalFloatNode) EvalFloat

func (n *EvalFloatNode) EvalFloat(scope *Scope, executionState ExecutionState) (float64, error)

func (*EvalFloatNode) EvalInt

func (n *EvalFloatNode) EvalInt(scope *Scope, executionState ExecutionState) (int64, error)

func (*EvalFloatNode) EvalMissing

func (n *EvalFloatNode) EvalMissing(scope *Scope, executionState ExecutionState) (*ast.Missing, error)

func (*EvalFloatNode) EvalRegex

func (n *EvalFloatNode) EvalRegex(scope *Scope, executionState ExecutionState) (*regexp.Regexp, error)

func (*EvalFloatNode) EvalString

func (n *EvalFloatNode) EvalString(scope *Scope, executionState ExecutionState) (string, error)

func (*EvalFloatNode) EvalTime

func (n *EvalFloatNode) EvalTime(scope *Scope, executionState ExecutionState) (time.Time, error)

func (*EvalFloatNode) IsDynamic

func (n *EvalFloatNode) IsDynamic() bool

func (*EvalFloatNode) String

func (n *EvalFloatNode) String() string

func (*EvalFloatNode) Type

func (n *EvalFloatNode) Type(scope ReadOnlyScope) (ast.ValueType, error)

type EvalFunctionNode

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

func NewEvalFunctionNode

func NewEvalFunctionNode(funcNode *ast.FunctionNode) (*EvalFunctionNode, error)

func (*EvalFunctionNode) EvalBool

func (n *EvalFunctionNode) EvalBool(scope *Scope, executionState ExecutionState) (bool, error)

func (*EvalFunctionNode) EvalDuration

func (n *EvalFunctionNode) EvalDuration(scope *Scope, executionState ExecutionState) (time.Duration, error)

func (*EvalFunctionNode) EvalFloat

func (n *EvalFunctionNode) EvalFloat(scope *Scope, executionState ExecutionState) (float64, error)

func (*EvalFunctionNode) EvalInt

func (n *EvalFunctionNode) EvalInt(scope *Scope, executionState ExecutionState) (int64, error)

func (*EvalFunctionNode) EvalMissing

func (n *EvalFunctionNode) EvalMissing(scope *Scope, executionState ExecutionState) (*ast.Missing, error)

func (*EvalFunctionNode) EvalRegex

func (n *EvalFunctionNode) EvalRegex(scope *Scope, executionState ExecutionState) (*regexp.Regexp, error)

func (*EvalFunctionNode) EvalString

func (n *EvalFunctionNode) EvalString(scope *Scope, executionState ExecutionState) (string, error)

func (*EvalFunctionNode) EvalTime

func (n *EvalFunctionNode) EvalTime(scope *Scope, executionState ExecutionState) (time.Time, error)

func (*EvalFunctionNode) IsDynamic

func (n *EvalFunctionNode) IsDynamic() bool

func (*EvalFunctionNode) String

func (n *EvalFunctionNode) String() string

func (*EvalFunctionNode) Type

func (n *EvalFunctionNode) Type(scope ReadOnlyScope) (ast.ValueType, error)

type EvalIntNode

type EvalIntNode struct {
	Int64 int64
}

func (*EvalIntNode) EvalBool

func (n *EvalIntNode) EvalBool(scope *Scope, executionState ExecutionState) (bool, error)

func (*EvalIntNode) EvalDuration

func (n *EvalIntNode) EvalDuration(scope *Scope, executionState ExecutionState) (time.Duration, error)

func (*EvalIntNode) EvalFloat

func (n *EvalIntNode) EvalFloat(scope *Scope, executionState ExecutionState) (float64, error)

func (*EvalIntNode) EvalInt

func (n *EvalIntNode) EvalInt(scope *Scope, executionState ExecutionState) (int64, error)

func (*EvalIntNode) EvalMissing

func (n *EvalIntNode) EvalMissing(scope *Scope, executionState ExecutionState) (*ast.Missing, error)

func (*EvalIntNode) EvalRegex

func (n *EvalIntNode) EvalRegex(scope *Scope, executionState ExecutionState) (*regexp.Regexp, error)

func (*EvalIntNode) EvalString

func (n *EvalIntNode) EvalString(scope *Scope, executionState ExecutionState) (string, error)

func (*EvalIntNode) EvalTime

func (n *EvalIntNode) EvalTime(scope *Scope, executionState ExecutionState) (time.Time, error)

func (*EvalIntNode) IsDynamic

func (n *EvalIntNode) IsDynamic() bool

func (*EvalIntNode) String

func (n *EvalIntNode) String() string

func (*EvalIntNode) Type

func (n *EvalIntNode) Type(scope ReadOnlyScope) (ast.ValueType, error)

type EvalLambdaNode

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

func NewEvalLambdaNode

func NewEvalLambdaNode(lambda *ast.LambdaNode) (*EvalLambdaNode, error)

func (*EvalLambdaNode) EvalBool

func (n *EvalLambdaNode) EvalBool(scope *Scope, _ ExecutionState) (bool, error)

func (*EvalLambdaNode) EvalDuration

func (n *EvalLambdaNode) EvalDuration(scope *Scope, _ ExecutionState) (time.Duration, error)

func (*EvalLambdaNode) EvalFloat

func (n *EvalLambdaNode) EvalFloat(scope *Scope, _ ExecutionState) (float64, error)

func (*EvalLambdaNode) EvalInt

func (n *EvalLambdaNode) EvalInt(scope *Scope, _ ExecutionState) (int64, error)

func (*EvalLambdaNode) EvalMissing

func (n *EvalLambdaNode) EvalMissing(scope *Scope, _ ExecutionState) (*ast.Missing, error)

func (*EvalLambdaNode) EvalRegex

func (n *EvalLambdaNode) EvalRegex(scope *Scope, _ ExecutionState) (*regexp.Regexp, error)

func (*EvalLambdaNode) EvalString

func (n *EvalLambdaNode) EvalString(scope *Scope, _ ExecutionState) (string, error)

func (*EvalLambdaNode) EvalTime

func (n *EvalLambdaNode) EvalTime(scope *Scope, _ ExecutionState) (time.Time, error)

func (*EvalLambdaNode) IsDynamic

func (n *EvalLambdaNode) IsDynamic() bool

func (*EvalLambdaNode) String

func (n *EvalLambdaNode) String() string

func (*EvalLambdaNode) Type

func (n *EvalLambdaNode) Type(scope ReadOnlyScope) (ast.ValueType, error)

type EvalReferenceNode

type EvalReferenceNode struct {
	Node *ast.ReferenceNode
}

func (*EvalReferenceNode) EvalBool

func (n *EvalReferenceNode) EvalBool(scope *Scope, executionState ExecutionState) (bool, error)

func (*EvalReferenceNode) EvalDuration

func (n *EvalReferenceNode) EvalDuration(scope *Scope, executionState ExecutionState) (time.Duration, error)

func (*EvalReferenceNode) EvalFloat

func (n *EvalReferenceNode) EvalFloat(scope *Scope, executionState ExecutionState) (float64, error)

func (*EvalReferenceNode) EvalInt

func (n *EvalReferenceNode) EvalInt(scope *Scope, executionState ExecutionState) (int64, error)

func (*EvalReferenceNode) EvalMissing

func (n *EvalReferenceNode) EvalMissing(scope *Scope, executionState ExecutionState) (*ast.Missing, error)

func (*EvalReferenceNode) EvalRegex

func (n *EvalReferenceNode) EvalRegex(scope *Scope, executionState ExecutionState) (*regexp.Regexp, error)

func (*EvalReferenceNode) EvalString

func (n *EvalReferenceNode) EvalString(scope *Scope, executionState ExecutionState) (string, error)

func (*EvalReferenceNode) EvalTime

func (n *EvalReferenceNode) EvalTime(scope *Scope, executionState ExecutionState) (time.Time, error)

func (*EvalReferenceNode) IsDynamic

func (n *EvalReferenceNode) IsDynamic() bool

func (*EvalReferenceNode) String

func (n *EvalReferenceNode) String() string

func (*EvalReferenceNode) Type

type EvalRegexNode

type EvalRegexNode struct {
	Node *ast.RegexNode
}

func (*EvalRegexNode) EvalBool

func (n *EvalRegexNode) EvalBool(scope *Scope, executionState ExecutionState) (bool, error)

func (*EvalRegexNode) EvalDuration

func (n *EvalRegexNode) EvalDuration(scope *Scope, executionState ExecutionState) (time.Duration, error)

func (*EvalRegexNode) EvalFloat

func (n *EvalRegexNode) EvalFloat(scope *Scope, executionState ExecutionState) (float64, error)

func (*EvalRegexNode) EvalInt

func (n *EvalRegexNode) EvalInt(scope *Scope, executionState ExecutionState) (int64, error)

func (*EvalRegexNode) EvalMissing

func (n *EvalRegexNode) EvalMissing(scope *Scope, executionState ExecutionState) (*ast.Missing, error)

func (*EvalRegexNode) EvalRegex

func (n *EvalRegexNode) EvalRegex(scope *Scope, executionState ExecutionState) (*regexp.Regexp, error)

func (*EvalRegexNode) EvalString

func (n *EvalRegexNode) EvalString(scope *Scope, executionState ExecutionState) (string, error)

func (*EvalRegexNode) EvalTime

func (n *EvalRegexNode) EvalTime(scope *Scope, executionState ExecutionState) (time.Time, error)

func (*EvalRegexNode) IsDynamic

func (n *EvalRegexNode) IsDynamic() bool

func (*EvalRegexNode) String

func (n *EvalRegexNode) String() string

func (*EvalRegexNode) Type

func (n *EvalRegexNode) Type(scope ReadOnlyScope) (ast.ValueType, error)

type EvalStringNode

type EvalStringNode struct {
	Node *ast.StringNode
}

func (*EvalStringNode) EvalBool

func (n *EvalStringNode) EvalBool(scope *Scope, executionState ExecutionState) (bool, error)

func (*EvalStringNode) EvalDuration

func (n *EvalStringNode) EvalDuration(scope *Scope, executionState ExecutionState) (time.Duration, error)

func (*EvalStringNode) EvalFloat

func (n *EvalStringNode) EvalFloat(scope *Scope, executionState ExecutionState) (float64, error)

func (*EvalStringNode) EvalInt

func (n *EvalStringNode) EvalInt(scope *Scope, executionState ExecutionState) (int64, error)

func (*EvalStringNode) EvalMissing

func (n *EvalStringNode) EvalMissing(scope *Scope, executionState ExecutionState) (*ast.Missing, error)

func (*EvalStringNode) EvalRegex

func (n *EvalStringNode) EvalRegex(scope *Scope, executionState ExecutionState) (*regexp.Regexp, error)

func (*EvalStringNode) EvalString

func (n *EvalStringNode) EvalString(scope *Scope, executionState ExecutionState) (string, error)

func (*EvalStringNode) EvalTime

func (n *EvalStringNode) EvalTime(scope *Scope, executionState ExecutionState) (time.Time, error)

func (*EvalStringNode) IsDynamic

func (n *EvalStringNode) IsDynamic() bool

func (*EvalStringNode) String

func (n *EvalStringNode) String() string

func (*EvalStringNode) Type

func (n *EvalStringNode) Type(scope ReadOnlyScope) (ast.ValueType, error)

type EvalUnaryNode

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

func NewEvalUnaryNode

func NewEvalUnaryNode(unaryNode *ast.UnaryNode) (*EvalUnaryNode, error)

func (*EvalUnaryNode) EvalBool

func (n *EvalUnaryNode) EvalBool(scope *Scope, executionState ExecutionState) (bool, error)

func (*EvalUnaryNode) EvalDuration

func (n *EvalUnaryNode) EvalDuration(scope *Scope, executionState ExecutionState) (time.Duration, error)

func (*EvalUnaryNode) EvalFloat

func (n *EvalUnaryNode) EvalFloat(scope *Scope, executionState ExecutionState) (float64, error)

func (*EvalUnaryNode) EvalInt

func (n *EvalUnaryNode) EvalInt(scope *Scope, executionState ExecutionState) (int64, error)

func (*EvalUnaryNode) EvalMissing

func (n *EvalUnaryNode) EvalMissing(scope *Scope, executionState ExecutionState) (*ast.Missing, error)

func (*EvalUnaryNode) EvalRegex

func (n *EvalUnaryNode) EvalRegex(scope *Scope, executionState ExecutionState) (*regexp.Regexp, error)

func (*EvalUnaryNode) EvalString

func (n *EvalUnaryNode) EvalString(scope *Scope, executionState ExecutionState) (string, error)

func (*EvalUnaryNode) EvalTime

func (n *EvalUnaryNode) EvalTime(scope *Scope, executionState ExecutionState) (time.Time, error)

func (*EvalUnaryNode) IsDynamic

func (n *EvalUnaryNode) IsDynamic() bool

func (*EvalUnaryNode) String

func (n *EvalUnaryNode) String() string

func (*EvalUnaryNode) Type

func (n *EvalUnaryNode) Type(scope ReadOnlyScope) (ast.ValueType, error)

type ExecutionState

type ExecutionState struct {
	Funcs Funcs
}

ExecutionState is auxiliary struct for data/context that needs to be passed to evaluation functions

func CreateExecutionState

func CreateExecutionState() ExecutionState

func (ExecutionState) ResetAll

func (ea ExecutionState) ResetAll()

type Expression

type Expression interface {
	Reset()

	Type(scope ReadOnlyScope) (ast.ValueType, error)

	EvalFloat(scope *Scope) (float64, error)
	EvalInt(scope *Scope) (int64, error)
	EvalString(scope *Scope) (string, error)
	EvalBool(scope *Scope) (bool, error)
	EvalDuration(scope *Scope) (time.Duration, error)

	Eval(scope *Scope) (interface{}, error)

	// Return a copy of the expression but with a Reset state.
	CopyReset() Expression
}

Expression is interface that describe expression with state and it's evaluation.

func NewExpression

func NewExpression(node ast.Node) (Expression, error)

NewExpression accept a node and try to "compile"/ "specialise" it in order to achieve better runtime performance.

For example:

Given a BinaryNode{ReferNode("value"), NumberNode{Float64:10}} during runtime
we can find the type of "value" and find the most matching comparison function - (float64,float64) or (int64,float64)

type Func

type Func interface {
	Reset()
	Call(...interface{}) (interface{}, error)
	Signature() map[Domain]ast.ValueType
}

A callable function from within the expression

type Funcs

type Funcs map[string]Func

Lookup for functions

func NewFunctions

func NewFunctions() Funcs

Return set of built-in Funcs

type NodeEvaluator

type NodeEvaluator interface {
	EvalFloat(scope *Scope, executionState ExecutionState) (float64, error)
	EvalInt(scope *Scope, executionState ExecutionState) (int64, error)
	EvalString(scope *Scope, executionState ExecutionState) (string, error)
	EvalBool(scope *Scope, executionState ExecutionState) (bool, error)
	EvalRegex(scope *Scope, executionState ExecutionState) (*regexp.Regexp, error)
	EvalTime(scope *Scope, executionState ExecutionState) (time.Time, error)
	EvalDuration(scope *Scope, executionState ExecutionState) (time.Duration, error)
	EvalMissing(scope *Scope, executionState ExecutionState) (*ast.Missing, error)

	// Type returns the type of ast.ValueType
	Type(scope ReadOnlyScope) (ast.ValueType, error)
	// Whether the type returned by the node can change.
	IsDynamic() bool
}

NodeEvaluator provides a generic way for trying to fetch node value, if a speicifc type is requested (so Value isn't called, the *Value is called) ErrTypeGuardFailed must be returned

type ReadOnlyScope

type ReadOnlyScope interface {
	Get(name string) (interface{}, error)
	References() []string
	DynamicFunc(name string) *DynamicFunc
}

type Scope

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

Contains a set of variables references and their values.

func NewScope

func NewScope() *Scope

Initialize a new Scope object.

func (*Scope) DynamicFunc

func (s *Scope) DynamicFunc(name string) *DynamicFunc

func (*Scope) DynamicMethod

func (s *Scope) DynamicMethod(name string) DynamicMethod

func (*Scope) Get

func (s *Scope) Get(name string) (interface{}, error)

Get returns the value of 'name'.

func (*Scope) Has

func (s *Scope) Has(name string) bool

Whether a value has been set on the scope

func (*Scope) References

func (s *Scope) References() []string

func (*Scope) Reset

func (s *Scope) Reset()

Reset all scope values to an empty state.

func (*Scope) Set

func (s *Scope) Set(name string, value interface{})

Set defines a name -> value pairing in the scope.

func (*Scope) SetDynamicFunc

func (s *Scope) SetDynamicFunc(name string, f *DynamicFunc)

func (*Scope) SetDynamicMethod

func (s *Scope) SetDynamicMethod(name string, m DynamicMethod)

type ScopePool

type ScopePool interface {
	Get() *Scope
	Put(scope *Scope)

	ReferenceVariables() []string
}

ScopePool - pooling mechanism for Scope The idea behind scope pool is to pool scopes and to put them only the needed variables for execution.

func NewScopePool

func NewScopePool(referenceVariables []string) ScopePool

NewScopePool - creates new ScopePool for the given Node

Jump to

Keyboard shortcuts

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