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

Interface Qualifier

interpreter/attributes.go:67–86  ·  view source on GitHub ↗

Qualifier marker interface for designating different qualifier values and where they appear within field selections and index call expressions (`_[_]`).

Source from the content-addressed store, hash-verified

65// Qualifier marker interface for designating different qualifier values and where they appear
66// within field selections and index call expressions (`_[_]`).
67type Qualifier interface {
68 // ID where the qualifier appears within an expression.
69 ID() int64
70
71 // IsOptional specifies whether the qualifier is optional.
72 // Instead of a direct qualification, an optional qualifier will be resolved via QualifyIfPresent
73 // rather than Qualify. A non-optional qualifier may also be resolved through QualifyIfPresent if
74 // the object to qualify is itself optional.
75 IsOptional() bool
76
77 // Qualify performs a qualification, e.g. field selection, on the input object and returns
78 // the value of the access and whether the value was set. A non-nil value with a false presence
79 // test result indicates that the value being returned is the default value.
80 Qualify(vars Activation, obj any) (any, error)
81
82 // QualifyIfPresent qualifies the object if the qualifier is declared or defined on the object.
83 // The 'presenceOnly' flag indicates that the value is not necessary, just a boolean status as
84 // to whether the qualifier is present.
85 QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error)
86}
87
88// ConstantQualifier interface embeds the Qualifier interface and provides an option to inspect the
89// qualifier's constant value.

Callers 20

maybeOptimizeConstUnaryFunction · 0.65
maybeBuildListLiteralFunction · 0.65
maybeBuildMapLiteralFunction · 0.65
optimizations.goFile · 0.65
ResolveMethod · 0.65
TestCustomDecoratorFunction · 0.65
applyQualifiersFunction · 0.65
attrQualifyFunction · 0.65
attrQualifyIfPresentFunction · 0.65

Implementers 13

nestedMsgQualifierinterpreter/attributes_test.go
boolQualifierinterpreter/attributes.go
fieldQualifierinterpreter/attributes.go
stringQualifierinterpreter/attributes.go
intQualifierinterpreter/attributes.go
uintQualifierinterpreter/attributes.go
doubleQualifierinterpreter/attributes.go
evalAttrinterpreter/interpretable.go
absoluteAttributeinterpreter/attributes.go
conditionalAttributeinterpreter/attributes.go
maybeAttributeinterpreter/attributes.go
relativeAttributeinterpreter/attributes.go

Calls

no outgoing calls

Tested by

no test coverage detected