# Packages
Package pb reflects over protocol buffer descriptors to generate objects that simplify type, enum, and field lookup.
Package ref contains the reference interfaces used throughout the types components.
Package traits defines interfaces that a type may implement to participate in operator overloads and function dispatch.
# Functions
AlphaProtoAsType converts a CEL v1alpha1.Type protobuf type to a CEL-native type representation.
DurationGetHours returns the duration in hours.
DurationGetMilliseconds returns duration in milliseconds.
DurationGetMinutes returns duration in minutes.
DurationGetSeconds returns duration in seconds.
Equal returns whether the two ref.Value are heterogeneously equivalent.
ExprTypeToType converts a protobuf CEL type representation to a CEL-native type representation.
IndexOrError converts an input index value into either a lossless integer index or an error.
InsertMapKeyValue inserts a key, value pair into the target map if the target map does not already contain the given key.
IsBool returns whether the input ref.Val or ref.Type is equal to BoolType.
IsError returns whether the input element ref.Type or ref.Val is equal to the ErrType singleton.
IsPrimitiveType returns whether the input element ref.Val is a primitive type.
IsUnknown returns whether the element ref.Val is in instance of *types.Unknown.
IsUnknownOrError returns whether the input element ref.Val is an ErrType or UnknownType.
LabelErrNode returns val unaltered it is not an Err or if the error has a non-zero AST node ID already present.
MaybeMergeUnknowns determines whether an input value and another, possibly nil, unknown will produce an unknown result.
MaybeNoSuchOverloadErr returns the error or unknown if the input ref.Val is one of these types, else a new no such overload error.
MergeUnknowns combines two unknown values into a new unknown value.
NewAttributeTrail creates a new simple attribute from a variable name.
NewDynamicList returns a traits.Lister with heterogenous elements.
NewDynamicMap returns a traits.Mapper value with dynamic key, value pairs.
NewEmptyRegistry returns a registry which is completely unconfigured.
NewErr creates a new Err described by the format string and args.
NewErrFromString creates a new Err with the provided message.
NewErrWithNodeID creates a new Err described by the format string and args.
NewJSONList returns a traits.Lister based on structpb.ListValue instance.
NewJSONStruct creates a traits.Mapper implementation backed by a JSON struct that has been encoded in protocol buffer form.
NewListType creates an instances of a list type value with the provided element type.
NewMapType creates an instance of a map type value with the provided key and value types.
NewMutableList creates a new mutable list whose internal state can be modified.
NewMutableMap constructs a mutable map from an adapter and a set of map values.
NewNullableType creates an instance of a nullable type with the provided wrapped type.
NewObject returns an object based on a proto.Message value which handles conversion between protobuf type values and expression type values.
NewObjectType creates a type reference to an externally defined type, e.g.
NewObjectTypeValue creates a type reference to an externally defined type.
NewOpaqueType creates an abstract parameterized type with a given name.
NewOptionalType creates an abstract parameterized type instance corresponding to CEL's notion of optional.
NewProtoList returns a traits.Lister based on a pb.List instance.
NewProtoMap returns a specialized traits.Mapper for handling protobuf map values.
NewRefValList returns a traits.Lister with ref.Val elements.
NewRefValMap returns a specialized traits.Mapper with CEL valued keys and values.
NewRegistry accepts a list of proto message instances and returns a type provider which can create new instances of the provided message or any message that proto depends upon in its FileDescriptor.
NewStringInterfaceMap returns a specialized traits.Mapper with string keys and interface values.
NewStringList returns a traits.Lister containing only strings.
NewStringStringMap returns a specialized traits.Mapper with string keys and values.
NewTypeParamType creates a parameterized type instance.
NewTypeTypeWithParam creates a type with a type parameter.
NewTypeValue creates an opaque type which has a set of optional type traits as defined in the common/types/traits package.
NewUnknown creates a new unknown at a given expression id for an attribute.
NoSuchOverloadErr returns a new types.Err instance with a no such overload message.
OptionalOf returns an optional value which wraps a concrete CEL value.
ProtoAsType converts a canonical CEL celpb.Type protobuf type to a CEL-native type representation.
QualifyAttribute qualifies an attribute using a valid AttributeQualifier type.
StringContains returns whether the string contains a substring.
StringEndsWith returns whether the target string contains the input suffix.
StringStartsWith returns whether the target string contains the input prefix.
ToFoldableList will create a Foldable version of a list suitable for key-value pair iteration.
ToFoldableMap will create a Foldable version of a map suitable for key-value pair iteration.
TypeToExprType converts a CEL-native type representation to a protobuf CEL Type representation.
TypeToProto converts from a CEL-native type representation to canonical CEL celpb.Type protobuf type.
UnsupportedRefValConversionErr returns a types.NewErr instance with a no such conversion message that indicates that the native value could not be converted to a CEL ref.Val.
ValOrErr either returns the existing error or creates a new one.
WrapErr wraps an existing Go error value into a CEL Err value.
# Constants
AnyKind represents a google.protobuf.Any type.
BoolKind represents a boolean type.
BytesKind represents a bytes type.
DoubleKind represents a double type.
DurationKind represents a CEL duration type.
DynKind represents a dynamic type.
ErrorKind represents a CEL error type.
Boolean constants.
IntKind represents an integer type.
Int constants used for comparison results.
Int constants used for comparison results.
IntZero is the zero-value for Int.
ListKind represents a list type.
MapKind represents a map type.
NullTypeKind represents a null type.
OpaqueKind represents an abstract type which has no accessible fields.
StringKind represents a string type.
StructKind represents a structured object with typed fields.
TimestampKind represents a a CEL time type.
Boolean constants.
TypeKind represents the CEL type.
TypeParamKind represents a parameterized type whose type name will be resolved at type-check time, if possible.
UintKind represents a uint type.
UnknownKind represents an unknown value type.
UnspecifiedKind is returned when the type is nil or its kind is not specified.
# Variables
AnyType represents the google.protobuf.Any type.
BoolType represents the bool type.
BytesType represents the bytes type.
DefaultTypeAdapter adapts canonical CEL types from their equivalent Go values.
DoubleType represents the double type.
DurationType represents the CEL duration type.
DynType represents a dynamic CEL type whose type will be determined at runtime from context.
ErrorType represents a CEL error value.
ErrType singleton.
IntType represents the int type.
IteratorType singleton.
ListType represents the runtime list type.
MapType represents the runtime map type.
NullType represents the type of a null value.
NullValue singleton.
OptionalNone is a sentinel value which is used to indicate an empty optional value.
OptionalType indicates the runtime type of an optional value.
ProtoCELPrimitives provides a map from the protoreflect Kind to the equivalent CEL type.
StringType represents the string type.
TimestampType represents the time type.
TypeType represents a CEL type.
UintType represents a uint type.
UnknownType represents an unknown value type.
# Structs
AttributeTrail specifies a variable with an optional qualifier path.
Duration type that implements ref.Val and supports add, compare, negate, and subtract operators.
Err type which extends the built-in go error and implements ref.Val.
FieldType represents a field's type value and whether that field supports presence detection.
Optional value which points to a value if non-empty.
Registry provides type information for a set of registered types.
Timestamp type implementation which supports add, compare, and subtract operations.
Type holds a reference to a runtime type with an optional type-checked set of type parameters.
Unknown type which collects expression ids which caused the current value to become unknown.
# Interfaces
AttributeQualifier constrains the possible types which may be used to qualify an attribute.
Error interface which allows types types.Err values to be treated as error values.
Provider specifies functions for creating new object instances and for resolving enum values by name.
# Type aliases
Adapter converts native Go values of varying type and complexity to equivalent CEL values.
Bool type that implements ref.Val and supports comparison and negation.
Bytes type that implements ref.Val and supports add, compare, and size operations.
Double type that implements ref.Val, comparison, and mathematical operations.
Int type that implements ref.Val as well as comparison and math operators.
Kind indicates a CEL type's kind which is used to differentiate quickly between simple and complex types.
Null type implementation.
String type implementation which supports addition, comparison, matching, and size functions.
Uint type implementation which supports comparison and math operators.