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

Function Sets

ext/sets.go:77–83  ·  view source on GitHub ↗

Sets returns a cel.EnvOption to configure namespaced set relationship functions. There is no set type within CEL, and while one may be introduced in the future, there are cases where a `list` type is known to behave like a set. For such cases, this library provides some basic functionality for dete

(options ...SetsOption)

Source from the content-addressed store, hash-verified

75// sets.intersects([1], [1, 2]) // true
76// sets.intersects([[1], [2, 3]], [[1, 2], [2, 3.0]]) // true
77func Sets(options ...SetsOption) cel.EnvOption {
78 l := &setsLib{}
79 for _, o := range options {
80 l = o(l)
81 }
82 return cel.Lib(l)
83}
84
85// SetsOption declares a functional operator for configuring set extensions.
86type SetsOption func(*setsLib) *setsLib

Callers 8

testK8sCostFunction · 0.92
TestSetsCostBoundsFunction · 0.92
evaluator.goFile · 0.92
initExtFactoriesFunction · 0.85
TestSetsVersionFunction · 0.85
testSetsEnvFunction · 0.85

Calls 1

LibFunction · 0.92

Tested by 6

testK8sCostFunction · 0.74
TestSetsCostBoundsFunction · 0.74
TestSetsVersionFunction · 0.68
testSetsEnvFunction · 0.68