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

Function VariableWithDoc

cel/decls.go:149–154  ·  view source on GitHub ↗

VariableWithDoc creates an instance of a variable declaration with a variable name, type, and doc string.

(name string, t *Type, doc string)

Source from the content-addressed store, hash-verified

147
148// VariableWithDoc creates an instance of a variable declaration with a variable name, type, and doc string.
149func VariableWithDoc(name string, t *Type, doc string) EnvOption {
150 return func(e *Env) (*Env, error) {
151 e.variables = append(e.variables, decls.NewVariableWithDoc(name, t, doc))
152 return e, nil
153 }
154}
155
156// VariableDecls configures a set of fully defined cel.VariableDecl instances in the environment.
157func VariableDecls(vars ...*decls.VariableDecl) EnvOption {

Callers 2

VariableFunction · 0.85

Calls 1

NewVariableWithDocFunction · 0.92

Tested by 1