celext

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultEnv

func DefaultEnv(useUTC bool) (*cel.Env, error)

DefaultEnv produces a cel.Env with the necessary cel.EnvOption and cel.ProgramOption values preconfigured for usage throughout the module. If useUTC is true, timestamp operations use the UTC timezone instead of the local timezone.

func ProtoFieldToCELType added in v0.5.0

func ProtoFieldToCELType(fieldDesc protoreflect.FieldDescriptor, generic, forItems bool) *cel.Type

ProtoFieldToCELType 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 ProtoFieldToCELValue added in v0.7.1

func ProtoFieldToCELValue(fieldDesc protoreflect.FieldDescriptor, value protoreflect.Value, forItems bool) ref.Val

func RequiredCELEnvOptions added in v0.5.0

func RequiredCELEnvOptions(fieldDesc protoreflect.FieldDescriptor) []cel.EnvOption

RequiredCELEnvOptions returns the options required to have expressions which rely on the provided descriptor.

Types

type Lib added in v0.6.3

type Lib struct {
	// contains filtered or unexported fields
}

Lib is the collection of 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

All implementations of protovalidate MUST implement these functions and should avoid exposing additional functions as they will not be portable.

func (Lib) CompileOptions added in v0.6.3

func (l Lib) CompileOptions() []cel.EnvOption

func (Lib) ProgramOptions added in v0.6.3

func (l Lib) ProgramOptions() []cel.ProgramOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL