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

Function FunctionBinding

common/decls/decls.go:1034–1045  ·  view source on GitHub ↗

FunctionBinding provides the implementation of a variadic overload. The provided function is protected by a runtime type-guard which ensures runtime type agreement between the overload signature and runtime argument types.

(binding functions.FunctionOp)

Source from the content-addressed store, hash-verified

1032// FunctionBinding provides the implementation of a variadic overload. The provided function is protected by a runtime
1033// type-guard which ensures runtime type agreement between the overload signature and runtime argument types.
1034func FunctionBinding(binding functions.FunctionOp) OverloadOpt {
1035 return func(o *OverloadDecl) (*OverloadDecl, error) {
1036 if o.HasBinding() {
1037 return nil, fmt.Errorf("overload already has a binding: %s", o.ID())
1038 }
1039 if o.hasLateBinding {
1040 return nil, fmt.Errorf("overload already has a late binding: %s", o.ID())
1041 }
1042 o.functionOp = binding
1043 return o, nil
1044 }
1045}
1046
1047// AsyncBinding provides the implementation of an asynchronous overload. The provided function
1048// is called in its own goroutine with the provided context. The function should block until

Calls 2

HasBindingMethod · 0.80
IDMethod · 0.65