Functions adds function overloads that extend or override the set of CEL built-ins. Deprecated: use Function() instead to declare the function, its overload signatures, and the overload implementations.
(funcs ...*functions.Overload)
| 535 | // Deprecated: use Function() instead to declare the function, its overload signatures, |
| 536 | // and the overload implementations. |
| 537 | func Functions(funcs ...*functions.Overload) ProgramOption { |
| 538 | return func(p *prog) (*prog, error) { |
| 539 | if err := p.dispatcher.Add(funcs...); err != nil { |
| 540 | return nil, err |
| 541 | } |
| 542 | return p, nil |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | // Globals sets the global variable values for a given program. These values may be shadowed by |
| 547 | // variables with the same name provided to the Eval() call. If Globals is used in a Library with |