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

Method CompileOptions

ext/sets.go:107–126  ·  view source on GitHub ↗

CompileOptions implements the Library interface method.

()

Source from the content-addressed store, hash-verified

105
106// CompileOptions implements the Library interface method.
107func (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.
129func (setsLib) ProgramOptions() []cel.ProgramOption {

Callers

nothing calls this directly

Calls 6

FunctionFunction · 0.92
OverloadFunction · 0.92
BinaryBindingFunction · 0.92
CostEstimatorOptionsFunction · 0.92
OverloadCostEstimateFunction · 0.92
estimateSetsCostFunction · 0.85

Tested by

no test coverage detected