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

Method AbsoluteAttribute

interpreter/attributes.go:168–186  ·  view source on GitHub ↗

AbsoluteAttribute refers to a variable value and an optional qualifier path. The namespaceNames represent the names the variable could have based on namespace resolution rules.

(id int64, names ...string)

Source from the content-addressed store, hash-verified

166// The namespaceNames represent the names the variable could have based on namespace
167// resolution rules.
168func (r *attrFactory) AbsoluteAttribute(id int64, names ...string) NamespacedAttribute {
169 disambiguateNames := false
170 for idx, name := range names {
171 if strings.HasPrefix(name, ".") {
172 disambiguateNames = true
173 names[idx] = strings.TrimPrefix(name, ".")
174 }
175 }
176 return &absoluteAttribute{
177 id: id,
178 namespaceNames: names,
179 disambiguateNames: disambiguateNames,
180 qualifiers: []Qualifier{},
181 adapter: r.adapter,
182 provider: r.provider,
183 fac: r,
184 errorOnBadPresenceTest: r.errorOnBadPresenceTest,
185 }
186}
187
188// ConditionalAttribute supports the case where an attribute selection may occur on a conditional
189// expression, e.g. (cond ? a : b).c

Callers 1

MaybeAttributeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected