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

Method CompileOptions

ext/sets.go:108–127  ·  view source on GitHub ↗

CompileOptions implements the Library interface method.

()

Source from the content-addressed store, hash-verified

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