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

Method AddQualifier

interpreter/attribute_patterns.go:352–366  ·  view source on GitHub ↗

AddQualifier implements the Attribute interface method.

(qual Qualifier)

Source from the content-addressed store, hash-verified

350
351// AddQualifier implements the Attribute interface method.
352func (m *attributeMatcher) AddQualifier(qual Qualifier) (Attribute, error) {
353 // Add the qualifier to the embedded NamespacedAttribute. If the input to the Resolve
354 // method is not a PartialActivation, or does not match an unknown attribute pattern, the
355 // Resolve method is directly invoked on the underlying NamespacedAttribute.
356 _, err := m.NamespacedAttribute.AddQualifier(qual)
357 if err != nil {
358 return nil, err
359 }
360 // The attributeMatcher overloads TryResolve and will attempt to match unknown patterns against
361 // the variable name and qualifier set contained within the Attribute. These values are not
362 // directly inspectable on the top-level NamespacedAttribute interface and so are tracked within
363 // the attributeMatcher.
364 m.qualifiers = append(m.qualifiers, qual)
365 return m, nil
366}
367
368// Resolve is an implementation of the NamespacedAttribute interface method which tests
369// for matching unknown attribute patterns and returns types.Unknown if present. Otherwise,

Callers

nothing calls this directly

Calls 1

AddQualifierMethod · 0.65

Tested by

no test coverage detected