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

Function ExpressionUnnestHeight

policy/composer.go:35–43  ·  view source on GitHub ↗

ExpressionUnnestHeight determines the height at which nested expressions are split into local variables within the cel.@block declaration.

(height int)

Source from the content-addressed store, hash-verified

33// ExpressionUnnestHeight determines the height at which nested expressions are split into local
34// variables within the cel.@block declaration.
35func ExpressionUnnestHeight(height int) ComposerOption {
36 return func(c *RuleComposer) (*RuleComposer, error) {
37 if height <= 0 {
38 return nil, fmt.Errorf("invalid unnest height: value must be positive: %d", height)
39 }
40 c.exprUnnestHeight = height
41 return c, nil
42 }
43}
44
45// NewRuleComposer creates a rule composer which stitches together rules within a policy into
46// a single CEL expression.

Callers 3

TestCompose_UnnestFunction · 0.85
helper_test.goFile · 0.85
TestRuleComposerErrorFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestCompose_UnnestFunction · 0.68
TestRuleComposerErrorFunction · 0.68