type Program … // NoVars returns an empty Activation. func NoVars() interpreter.Activation { … } // PartialVars returns a PartialActivation which contains variables and a set of AttributePattern // values that indicate variables or parts of variables whose value are not yet known. // // This method relies on manually configured sets of missing attribute patterns. For a method which // infers the missing variables from the input and the configured environment, use Env.PartialVars(). // // The `vars` value may either be an interpreter.Activation or any valid input to the // interpreter.NewActivation call. func PartialVars(vars any, unknowns ...*interpreter.AttributePattern) (interpreter.PartialActivation, error) { … } // AttributePattern returns an AttributePattern that matches a top-level variable. The pattern is // mutable, and its methods support the specification of one or more qualifier patterns. // // For example, the AttributePattern(`a`).QualString(`b`) represents a variable access `a` with a // string field or index qualification `b`. This pattern will match Attributes `a`, and `a.b`, // but not `a.c`. // // When using a CEL expression within a container, e.g. a package or namespace, the variable name // in the pattern must match the qualified name produced during the variable namespace resolution. // For example, when variable `a` is declared within an expression whose container is `ns.app`, the // fully qualified variable name may be `ns.app.a`, `ns.a`, or `a` per the CEL namespace resolution // rules. Pick the fully qualified variable name that makes sense within the container as the // AttributePattern `varName` argument. // // See the interpreter.AttributePattern and interpreter.AttributeQualifierPattern for more info // about how to create and manipulate AttributePattern values. func AttributePattern(varName string) *interpreter.AttributePattern { … } type EvalDetails … // State of the evaluation, non-nil if the OptTrackState or OptExhaustiveEval is specified // within EvalOptions. func (ed *EvalDetails) State() interpreter.EvalState { … } // ActualCost returns the tracked cost through the course of execution when `CostTracking` is enabled. // Otherwise, returns nil if the cost was not enabled. func (ed *EvalDetails) ActualCost() *uint64 { … } type prog … func (p *prog) clone() *prog { … } // newProgram creates a program instance with an environment, an ast, and an optional list of // ProgramOption values. // // If the program cannot be configured the prog will be nil, with a non-nil error response. func newProgram(e *Env, a *Ast, opts []ProgramOption) (Program, error) { … } func (p *prog) initInterpretable(a *Ast, decs []interpreter.InterpretableDecorator) (*prog, error) { … } // Eval implements the Program interface method. func (p *prog) Eval(input any) (v ref.Val, det *EvalDetails, err error) { … } // ContextEval implements the Program interface. func (p *prog) ContextEval(ctx context.Context, input any) (ref.Val, *EvalDetails, error) { … } type progFactory … type progGen … // newProgGen tests the factory object by calling it once and returns a factory-based Program if // the test is successful. func newProgGen(factory progFactory) (Program, error) { … } // Eval implements the Program interface method. func (gen *progGen) Eval(input any) (ref.Val, *EvalDetails, error) { … } // ContextEval implements the Program interface method. func (gen *progGen) ContextEval(ctx context.Context, input any) (ref.Val, *EvalDetails, error) { … } type ctxEvalActivation … // ResolveName implements the Activation interface method, but adds a special #interrupted variable // which is capable of testing whether a 'done' signal is provided from a context.Context channel. func (a *ctxEvalActivation) ResolveName(name string) (any, bool) { … } func (a *ctxEvalActivation) Parent() interpreter.Activation { … } func newCtxEvalActivationPool() *ctxEvalActivationPool { … } type ctxEvalActivationPool … // Setup initializes a pooled Activation with the ability check for context.Context cancellation func (p *ctxEvalActivationPool) Setup(vars interpreter.Activation, done <-chan struct{ … } type evalActivation … // ResolveName looks up the value of the input variable name, if found. // // Lazy bindings may be supplied within the map-based input in either of the following forms: // - func() any // - func() ref.Val // // The lazy binding will only be invoked once per evaluation. // // Values which are not represented as ref.Val types on input may be adapted to a ref.Val using // the types.Adapter configured in the environment. func (a *evalActivation) ResolveName(name string) (any, bool) { … } // Parent implements the interpreter.Activation interface func (a *evalActivation) Parent() interpreter.Activation { … } func newEvalActivationPool() *evalActivationPool { … } type evalActivationPool … // Setup initializes a pooled Activation object with the map input. func (p *evalActivationPool) Setup(vars map[string]any) *evalActivation { … } func (p *evalActivationPool) Put(value any) { … } var activationPool … var ctxActivationPool …