Documentation ¶
Index ¶
- type TypeProvider
- func (p *TypeProvider) EnumValue(enumName string) ref.Val
- func (p *TypeProvider) FindIdent(identName string) (ref.Val, bool)
- func (p *TypeProvider) FindStructFieldType(structType, fieldName string) (*types.FieldType, bool)
- func (p *TypeProvider) FindStructType(structType string) (*types.Type, bool)
- func (p *TypeProvider) NewValue(structType string, fields map[string]ref.Val) ref.Val
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TypeProvider ¶
type TypeProvider struct {
// contains filtered or unexported fields
}
TypeProvider is a specialized CEL type provider that understands the Object type alias that is used to construct an Apply configuration for a mutation operation.
func NewTypeProviderAndEnvOption ¶
func NewTypeProviderAndEnvOption(resolver common.TypeResolver) (*TypeProvider, cel.EnvOption)
NewTypeProviderAndEnvOption creates the TypeProvider with a given TypeResolver, and also returns the CEL EnvOption to apply it to the env.
func (*TypeProvider) EnumValue ¶
func (p *TypeProvider) EnumValue(enumName string) ref.Val
EnumValue returns the numeric value of the given enum value name. This TypeProvider does not have special handling for EnumValue and thus directly delegate to its underlying type provider.
func (*TypeProvider) FindIdent ¶
func (p *TypeProvider) FindIdent(identName string) (ref.Val, bool)
FindIdent takes a qualified identifier name and returns a ref.ObjectVal if one exists. This TypeProvider does not have special handling for FindIdent and thus directly delegate to its underlying type provider.
func (*TypeProvider) FindStructFieldType ¶
func (p *TypeProvider) FindStructFieldType(structType, fieldName string) (*types.FieldType, bool)
FindStructFieldType returns the field type for a checked type value. Returns false if the field could not be found.
func (*TypeProvider) FindStructType ¶
func (p *TypeProvider) FindStructType(structType string) (*types.Type, bool)
FindStructType returns the Type give a qualified type name, by looking it up with the TypeResolver and translating it to CEL Type. If the type is not known to the TypeResolver, the lookup falls back to the underlying TypeProvider instead.