type Kind … const UnspecifiedKind … const DynKind … const AnyKind … const BoolKind … const BytesKind … const DoubleKind … const DurationKind … const ErrorKind … const IntKind … const ListKind … const MapKind … const NullTypeKind … const OpaqueKind … const StringKind … const StructKind … const TimestampKind … const TypeKind … const TypeParamKind … const UintKind … const UnknownKind … var AnyType … var BoolType … var BytesType … var DoubleType … var DurationType … var DynType … var ErrorType … var IntType … var ListType … var MapType … var NullType … var StringType … var TimestampType … var TypeType … var UintType … var UnknownType … var _ … var _ … type Type … // ConvertToNative implements ref.Val.ConvertToNative. func (t *Type) ConvertToNative(typeDesc reflect.Type) (any, error) { … } // ConvertToType implements ref.Val.ConvertToType. func (t *Type) ConvertToType(typeVal ref.Type) ref.Val { … } // Equal indicates whether two types have the same runtime type name. // // The name Equal is a bit of a misnomer, but for historical reasons, this is the // runtime behavior. For a more accurate definition see IsType(). func (t *Type) Equal(other ref.Val) ref.Val { … } // HasTrait implements the ref.Type interface method. func (t *Type) HasTrait(trait int) bool { … } // IsExactType indicates whether the two types are exactly the same. This check also verifies type parameter type names. func (t *Type) IsExactType(other *Type) bool { … } // IsEquivalentType indicates whether two types are equivalent. This check ignores type parameter type names. func (t *Type) IsEquivalentType(other *Type) bool { … } // Kind indicates general category of the type. func (t *Type) Kind() Kind { … } // isTypeInternal checks whether the two types are equivalent or exactly the same based on the checkTypeParamName flag. func (t *Type) isTypeInternal(other *Type, checkTypeParamName bool) bool { … } // IsAssignableType determines whether the current type is type-check assignable from the input fromType. func (t *Type) IsAssignableType(fromType *Type) bool { … } // IsAssignableRuntimeType determines whether the current type is runtime assignable from the input runtimeType. // // At runtime, parameterized types are erased and so a function which type-checks to support a map(string, string) // will have a runtime assignable type of a map. func (t *Type) IsAssignableRuntimeType(val ref.Val) bool { … } // Parameters returns the list of type parameters if set. // // For ListKind, Parameters()[0] represents the list element type // For MapKind, Parameters()[0] represents the map key type, and Parameters()[1] represents the map // value type. func (t *Type) Parameters() []*Type { … } // DeclaredTypeName indicates the fully qualified and parameterized type-check type name. func (t *Type) DeclaredTypeName() string { … } // Type implements the ref.Val interface method. func (t *Type) Type() ref.Type { … } // Value implements the ref.Val interface method. func (t *Type) Value() any { … } // TypeName returns the type-erased fully qualified runtime type name. // // TypeName implements the ref.Type interface method. func (t *Type) TypeName() string { … } // WithTraits creates a copy of the current Type and sets the trait mask to the traits parameter. // // This method should be used with Opaque types where the type acts like a container, e.g. vector. func (t *Type) WithTraits(traits int) *Type { … } // String returns a human-readable definition of the type name. func (t *Type) String() string { … } // isDyn indicates whether the type is dynamic in any way. func (t *Type) isDyn() bool { … } // defaultIsAssignableType provides the standard definition of what it means for one type to be assignable to another // where any of the following may return a true result: // - The from types are the same instance // - The target type is dynamic // - The fromType has the same kind and type name as the target type, and all parameters of the target type // // are IsAssignableType() from the parameters of the fromType. func (t *Type) defaultIsAssignableType(fromType *Type) bool { … } // defaultIsAssignableRuntimeType inspects the type and in the case of list and map elements, the key and element types // to determine whether a ref.Val is assignable to the declared type for a function signature. func (t *Type) defaultIsAssignableRuntimeType(val ref.Val) bool { … } // NewListType creates an instances of a list type value with the provided element type. func NewListType(elemType *Type) *Type { … } // NewMapType creates an instance of a map type value with the provided key and value types. func NewMapType(keyType, valueType *Type) *Type { … } // NewNullableType creates an instance of a nullable type with the provided wrapped type. // // Note: only primitive types are supported as wrapped types. func NewNullableType(wrapped *Type) *Type { … } // NewOptionalType creates an abstract parameterized type instance corresponding to CEL's notion of optional. func NewOptionalType(param *Type) *Type { … } // NewOpaqueType creates an abstract parameterized type with a given name. func NewOpaqueType(name string, params ...*Type) *Type { … } // NewObjectType creates a type reference to an externally defined type, e.g. a protobuf message type. // // An object type is assumed to support field presence testing and field indexing. Additionally, the // type may also indicate additional traits through the use of the optional traits vararg argument. func NewObjectType(typeName string, traits ...int) *Type { … } // NewObjectTypeValue creates a type reference to an externally defined type. // // Deprecated: use cel.ObjectType(typeName) func NewObjectTypeValue(typeName string) *Type { … } // NewTypeValue creates an opaque type which has a set of optional type traits as defined in // the common/types/traits package. // // Deprecated: use cel.ObjectType(typeName, traits) func NewTypeValue(typeName string, traits ...int) *Type { … } // NewTypeParamType creates a parameterized type instance. func NewTypeParamType(paramName string) *Type { … } // NewTypeTypeWithParam creates a type with a type parameter. // Used for type-checking purposes, but equivalent to TypeType otherwise. func NewTypeTypeWithParam(param *Type) *Type { … } // TypeToExprType converts a CEL-native type representation to a protobuf CEL Type representation. func TypeToExprType(t *Type) (*exprpb.Type, error) { … } // ExprTypeToType converts a protobuf CEL type representation to a CEL-native type representation. func ExprTypeToType(t *exprpb.Type) (*Type, error) { … } func maybeWrapper(t *Type, pbType *exprpb.Type) *exprpb.Type { … } func maybeForeignType(t ref.Type) *Type { … } var checkedWellKnowns … var emptyParams … var allTraits … var structTypeTraitMask …