CompileOptions implements the Library interface method.
()
| 105 | |
| 106 | // CompileOptions implements the Library interface method. |
| 107 | func (setsLib) CompileOptions() []cel.EnvOption { |
| 108 | listType := cel.ListType(cel.TypeParamType("T")) |
| 109 | return []cel.EnvOption{ |
| 110 | cel.Function("sets.contains", |
| 111 | cel.Overload("list_sets_contains_list", []*cel.Type{listType, listType}, cel.BoolType, |
| 112 | cel.BinaryBinding(setsContains))), |
| 113 | cel.Function("sets.equivalent", |
| 114 | cel.Overload("list_sets_equivalent_list", []*cel.Type{listType, listType}, cel.BoolType, |
| 115 | cel.BinaryBinding(setsEquivalent))), |
| 116 | cel.Function("sets.intersects", |
| 117 | cel.Overload("list_sets_intersects_list", []*cel.Type{listType, listType}, cel.BoolType, |
| 118 | cel.BinaryBinding(setsIntersects))), |
| 119 | cel.CostEstimatorOptions( |
| 120 | checker.OverloadCostEstimate("list_sets_contains_list", estimateSetsCost(1)), |
| 121 | checker.OverloadCostEstimate("list_sets_intersects_list", estimateSetsCost(1)), |
| 122 | // equivalence requires potentially two m*n comparisons to ensure each list is contained by the other |
| 123 | checker.OverloadCostEstimate("list_sets_equivalent_list", estimateSetsCost(2)), |
| 124 | ), |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | // ProgramOptions implements the Library interface method. |
| 129 | func (setsLib) ProgramOptions() []cel.ProgramOption { |
nothing calls this directly
no test coverage detected