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

Struct FunctionDecl

common/decls/decls.go:58–84  ·  view source on GitHub ↗

FunctionDecl defines a function name, overload set, and optionally a singleton definition for all overload instances.

Source from the content-addressed store, hash-verified

56// FunctionDecl defines a function name, overload set, and optionally a singleton definition for all
57// overload instances.
58type FunctionDecl struct {
59 name string
60 doc string
61
62 // overloads associated with the function name.
63 overloads map[string]*OverloadDecl
64
65 // singleton implementation of the function for all overloads.
66 //
67 // If this option is set, an error will occur if any overloads specify a per-overload implementation
68 // or if another function with the same name attempts to redefine the singleton.
69 singleton *functions.Overload
70
71 // disableTypeGuards is a performance optimization to disable detailed runtime type checks which could
72 // add overhead on common operations. Setting this option true leaves error checks and argument checks
73 // intact.
74 disableTypeGuards bool
75
76 // state indicates that the binding should be provided as a declaration, as a runtime binding, or both.
77 state declarationState
78
79 // overloadOrdinals indicates the order in which the overload was declared.
80 overloadOrdinals []string
81
82 // overloadDecls caches the slice of overloads in declaration order.
83 overloadDecls []*OverloadDecl
84}
85
86type declarationState int
87

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected