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

Method ConditionIsLiteral

policy/compiler.go:139–142  ·  view source on GitHub ↗

ConditionIsLiteral indicates whether the condition for the match is a literal with a given value.

(val ref.Val)

Source from the content-addressed store, hash-verified

137
138// ConditionIsLiteral indicates whether the condition for the match is a literal with a given value.
139func (m *CompiledMatch) ConditionIsLiteral(val ref.Val) bool {
140 c := m.cond.NativeRep().Expr()
141 return c.Kind() == ast.LiteralKind && c.AsLiteral().Equal(val) == types.True
142}
143
144// Output returns the compiled output expression associated with the match block, if set.
145func (m *CompiledMatch) Output() *OutputValue {

Callers 2

HasOptionalOutputMethod · 0.80
checkUnreachableCodeMethod · 0.80

Calls 5

NativeRepMethod · 0.80
ExprMethod · 0.65
KindMethod · 0.65
EqualMethod · 0.65
AsLiteralMethod · 0.65

Tested by

no test coverage detected