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

Method CompileOptions

examples/example_cel_member_test.go:55–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53type customLib struct{}
54
55func (customLib) CompileOptions() []cel.EnvOption {
56 return []cel.EnvOption{
57 cel.Variable("i", cel.StringType),
58 cel.Variable("you", cel.StringType),
59 cel.Function("greet",
60 cel.MemberOverload("string_greet_string",
61 []*cel.Type{cel.StringType, cel.StringType},
62 cel.StringType,
63 cel.BinaryBinding(func(lhs, rhs ref.Val) ref.Val {
64 return types.String(
65 fmt.Sprintf("Hello %s! Nice to meet you, I'm %s.\n", rhs, lhs))
66 }),
67 ),
68 ),
69 }
70}
71
72func (customLib) ProgramOptions() []cel.ProgramOption {
73 return []cel.ProgramOption{}

Callers

nothing calls this directly

Calls 5

VariableFunction · 0.92
FunctionFunction · 0.92
MemberOverloadFunction · 0.92
BinaryBindingFunction · 0.92
StringTypeAlias · 0.92

Tested by

no test coverage detected