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

Method Matches

interpreter/attribute_patterns.go:117–123  ·  view source on GitHub ↗

Matches returns true if the qualifier pattern is a wildcard, or the Qualifier implements the qualifierValueEquator interface and its IsValueEqualTo returns true for the qualifier pattern.

(q Qualifier)

Source from the content-addressed store, hash-verified

115// Matches returns true if the qualifier pattern is a wildcard, or the Qualifier implements the
116// qualifierValueEquator interface and its IsValueEqualTo returns true for the qualifier pattern.
117func (qpat *AttributeQualifierPattern) Matches(q Qualifier) bool {
118 if qpat.wildcard {
119 return true
120 }
121 qve, ok := q.(qualifierValueEquator)
122 return ok && qve.QualifierValueEquals(qpat.value)
123}
124
125// qualifierValueEquator defines an interface for determining if an input value, of valid map key
126// type, is equal to the value held in the Qualifier. This interface is used by the

Callers 1

Calls 1

QualifierValueEqualsMethod · 0.65

Tested by

no test coverage detected