()
| 53 | type customLib struct{} |
| 54 | |
| 55 | func (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 | |
| 72 | func (customLib) ProgramOptions() []cel.ProgramOption { |
| 73 | return []cel.ProgramOption{} |
nothing calls this directly
no test coverage detected