Documentation
¶
Index ¶
- func NewLibrary() cel.Library
- func ProtoFieldToType(fieldDesc protoreflect.FieldDescriptor, generic, forItems bool) *cel.Type
- func ProtoFieldToValue(fieldDesc protoreflect.FieldDescriptor, value protoreflect.Value, ...) ref.Val
- func RequiredEnvOptions(fieldDesc protoreflect.FieldDescriptor) []cel.EnvOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLibrary ¶
NewLibrary creates a new CEL library that specifies all of the functions and settings required by protovalidate beyond the standard definitions of the CEL Specification:
https://github.com/google/cel-spec/blob/master/doc/langdef.md#list-of-standard-definitions
Using this function, you can create a CEL environment that is identical to the one used to evaluate protovalidate CEL expressions.
func ProtoFieldToType ¶
func ProtoFieldToType(fieldDesc protoreflect.FieldDescriptor, generic, forItems bool) *cel.Type
ProtoFieldToType resolves the CEL value type for the provided FieldDescriptor. If generic is true, the specific subtypes of map and repeated fields will be replaced with cel.DynType. If forItems is true, the type for the repeated list items is returned instead of the list type itself.
func ProtoFieldToValue ¶
func ProtoFieldToValue(fieldDesc protoreflect.FieldDescriptor, value protoreflect.Value, forItems bool) ref.Val
func RequiredEnvOptions ¶
func RequiredEnvOptions(fieldDesc protoreflect.FieldDescriptor) []cel.EnvOption
RequiredEnvOptions returns the options required to have expressions which rely on the provided descriptor.
Types ¶
This section is empty.