MCPcopy Create free account
hub / github.com/cel-expr/cel-go / FunctionVars

Function FunctionVars

cel/program.go:161–163  ·  view source on GitHub ↗

FunctionVars returns a FunctionActivation combining the variable bindings from `vars` with the late-bound function implementations from `funcs`. FunctionVars support late-bound function definitions where the function behavior depends on the context of the evaluation. This can only be accomplished by

(vars any, funcs map[string]LateBoundFunction)

Source from the content-addressed store, hash-verified

159// input. For example, a function comparing a validity window `valid_until(t)` could be implemented as
160// a late-bound function closed over a fixed timestamp value.
161func FunctionVars(vars any, funcs map[string]LateBoundFunction) (FunctionActivation, error) {
162 return interpreter.NewFunctionActivation(vars, funcs)
163}
164
165// AttributePattern returns an AttributePattern that matches a top-level variable. The pattern is
166// mutable, and its methods support the specification of one or more qualifier patterns.

Calls 1

NewFunctionActivationFunction · 0.92