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

Function NewGlobalMacro

parser/macro.go:48–57  ·  view source on GitHub ↗

NewGlobalMacro creates a Macro for a global function with the specified arg count.

(function string, argCount int, expander MacroExpander, opts ...MacroOpt)

Source from the content-addressed store, hash-verified

46
47// NewGlobalMacro creates a Macro for a global function with the specified arg count.
48func NewGlobalMacro(function string, argCount int, expander MacroExpander, opts ...MacroOpt) Macro {
49 m := &macro{
50 function: function,
51 argCount: argCount,
52 expander: expander}
53 for _, opt := range opts {
54 m = opt(m)
55 }
56 return m
57}
58
59// NewReceiverMacro creates a Macro for a receiver function matching the specified arg count.
60func NewReceiverMacro(function string, argCount int, expander MacroExpander, opts ...MacroOpt) Macro {

Callers 4

GlobalMacroFunction · 0.92
NewGlobalMacroFunction · 0.92
macro.goFile · 0.70
TestExprHelperCopyFunction · 0.70

Calls

no outgoing calls

Tested by 1

TestExprHelperCopyFunction · 0.56