cel

package
v0.13.7 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 33 Imported by: 1

Documentation

Index

Constants

View Source
const ListPackageName = "list"
View Source
const MetadataPackageName = "metadata"
View Source
const RandPackageName = "rand"
View Source
const TimePackageName = "time"
View Source
const UUIDPackageName = "uuid"

Variables

View Source
var (
	SourceType = types.NewObjectType(createRandName("Source"))
	RandType   = types.NewObjectType(createRandName("Rand"))
)
View Source
var (
	ErrOutOfRangeAccessWasmMemory = errors.New(
		`grpc-federation: detected out of range access`,
	)
	ErrWasmContentMismatch = errors.New(
		`grpc-federation: wasm file content mismatch`,
	)
)
View Source
var File_grpc_federation_private_proto protoreflect.FileDescriptor
View Source
var (
	LocationType = types.NewObjectType(createTimeName("Location"))
)
View Source
var (
	UUIDType = types.NewObjectType(createUUIDName("UUID"))
)

Functions

func IsStandardLibraryType added in v0.9.2

func IsStandardLibraryType(typeName string) bool

Types

type CELFunction added in v0.10.0

type CELFunction struct {
	Name     string
	ID       string
	Args     []*cel.Type
	Return   *cel.Type
	IsMethod bool
}

type CELPlugin added in v0.10.0

type CELPlugin struct {
	Name      string
	Functions []*CELFunction
	// contains filtered or unexported fields
}

func NewCELPlugin added in v0.10.0

func NewCELPlugin(ctx context.Context, cfg CELPluginConfig) (*CELPlugin, error)

func (*CELPlugin) CompileOptions added in v0.10.0

func (p *CELPlugin) CompileOptions() []cel.EnvOption

func (*CELPlugin) LibraryName added in v0.10.0

func (p *CELPlugin) LibraryName() string

func (*CELPlugin) ProgramOptions added in v0.10.0

func (p *CELPlugin) ProgramOptions() []cel.ProgramOption

func (*CELPlugin) SetContext added in v0.11.0

func (p *CELPlugin) SetContext(ctx context.Context)

type CELPluginConfig added in v0.10.0

type CELPluginConfig struct {
	Name      string
	Wasm      WasmConfig
	Functions []*CELFunction
}

type Error added in v0.13.6

type Error struct {
	Code                 int32                             `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message              string                            `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	Details              []*anypb.Any                      `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"`
	CustomMessages       []*anypb.Any                      `protobuf:"bytes,4,rep,name=custom_messages,json=customMessages,proto3" json:"custom_messages,omitempty"`
	ErrorInfo            []*errdetails.ErrorInfo           `protobuf:"bytes,5,rep,name=error_info,json=errorInfo,proto3" json:"error_info,omitempty"`
	RetryInfo            []*errdetails.RetryInfo           `protobuf:"bytes,6,rep,name=retry_info,json=retryInfo,proto3" json:"retry_info,omitempty"`
	DebugInfo            []*errdetails.DebugInfo           `protobuf:"bytes,7,rep,name=debug_info,json=debugInfo,proto3" json:"debug_info,omitempty"`
	QuotaFailures        []*errdetails.QuotaFailure        `protobuf:"bytes,8,rep,name=quota_failures,json=quotaFailures,proto3" json:"quota_failures,omitempty"`
	PreconditionFailures []*errdetails.PreconditionFailure `protobuf:"bytes,9,rep,name=precondition_failures,json=preconditionFailures,proto3" json:"precondition_failures,omitempty"`
	BadRequests          []*errdetails.BadRequest          `protobuf:"bytes,10,rep,name=bad_requests,json=badRequests,proto3" json:"bad_requests,omitempty"`
	RequestInfo          []*errdetails.RequestInfo         `protobuf:"bytes,11,rep,name=request_info,json=requestInfo,proto3" json:"request_info,omitempty"`
	ResourceInfo         []*errdetails.ResourceInfo        `protobuf:"bytes,12,rep,name=resource_info,json=resourceInfo,proto3" json:"resource_info,omitempty"`
	Helps                []*errdetails.Help                `protobuf:"bytes,13,rep,name=helps,proto3" json:"helps,omitempty"`
	LocalizedMessages    []*errdetails.LocalizedMessage    `protobuf:"bytes,14,rep,name=localized_messages,json=localizedMessages,proto3" json:"localized_messages,omitempty"`
	// contains filtered or unexported fields
}

Error type information of the error variable used when evaluating CEL.

func (*Error) CloneMessageVT added in v0.13.6

func (m *Error) CloneMessageVT() proto.Message

func (*Error) CloneVT added in v0.13.6

func (m *Error) CloneVT() *Error

func (*Error) Descriptor deprecated added in v0.13.6

func (*Error) Descriptor() ([]byte, []int)

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) EqualMessageVT added in v0.13.6

func (this *Error) EqualMessageVT(thatMsg proto.Message) bool

func (*Error) EqualVT added in v0.13.6

func (this *Error) EqualVT(that *Error) bool

func (*Error) GetBadRequests added in v0.13.6

func (x *Error) GetBadRequests() []*errdetails.BadRequest

func (*Error) GetCode added in v0.13.6

func (x *Error) GetCode() int32

func (*Error) GetCustomMessages added in v0.13.6

func (x *Error) GetCustomMessages() []*anypb.Any

func (*Error) GetDebugInfo added in v0.13.6

func (x *Error) GetDebugInfo() []*errdetails.DebugInfo

func (*Error) GetDetails added in v0.13.6

func (x *Error) GetDetails() []*anypb.Any

func (*Error) GetErrorInfo added in v0.13.6

func (x *Error) GetErrorInfo() []*errdetails.ErrorInfo

func (*Error) GetHelps added in v0.13.6

func (x *Error) GetHelps() []*errdetails.Help

func (*Error) GetLocalizedMessages added in v0.13.6

func (x *Error) GetLocalizedMessages() []*errdetails.LocalizedMessage

func (*Error) GetMessage added in v0.13.6

func (x *Error) GetMessage() string

func (*Error) GetPreconditionFailures added in v0.13.6

func (x *Error) GetPreconditionFailures() []*errdetails.PreconditionFailure

func (*Error) GetQuotaFailures added in v0.13.6

func (x *Error) GetQuotaFailures() []*errdetails.QuotaFailure

func (*Error) GetRequestInfo added in v0.13.6

func (x *Error) GetRequestInfo() []*errdetails.RequestInfo

func (*Error) GetResourceInfo added in v0.13.6

func (x *Error) GetResourceInfo() []*errdetails.ResourceInfo

func (*Error) GetRetryInfo added in v0.13.6

func (x *Error) GetRetryInfo() []*errdetails.RetryInfo

func (*Error) MarshalToSizedBufferVT added in v0.13.6

func (m *Error) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Error) MarshalToSizedBufferVTStrict added in v0.13.6

func (m *Error) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error)

func (*Error) MarshalToVT added in v0.13.6

func (m *Error) MarshalToVT(dAtA []byte) (int, error)

func (*Error) MarshalToVTStrict added in v0.13.6

func (m *Error) MarshalToVTStrict(dAtA []byte) (int, error)

func (*Error) MarshalVT added in v0.13.6

func (m *Error) MarshalVT() (dAtA []byte, err error)

func (*Error) MarshalVTStrict added in v0.13.6

func (m *Error) MarshalVTStrict() (dAtA []byte, err error)

func (*Error) ProtoMessage added in v0.13.6

func (*Error) ProtoMessage()

func (*Error) ProtoReflect added in v0.13.6

func (x *Error) ProtoReflect() protoreflect.Message

func (*Error) Reset added in v0.13.6

func (x *Error) Reset()

func (*Error) SizeVT added in v0.13.6

func (m *Error) SizeVT() (n int)

func (*Error) String added in v0.13.6

func (x *Error) String() string

func (*Error) UnmarshalVT added in v0.13.6

func (m *Error) UnmarshalVT(dAtA []byte) error

func (*Error) UnmarshalVTUnsafe added in v0.13.6

func (m *Error) UnmarshalVTUnsafe(dAtA []byte) error

type Library

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

func NewContextualLibrary added in v0.10.0

func NewContextualLibrary(ctx context.Context) *Library

func NewLibrary

func NewLibrary() *Library

func (*Library) CompileOptions

func (lib *Library) CompileOptions() []cel.EnvOption

func (*Library) LibraryName

func (lib *Library) LibraryName() string

func (*Library) ProgramOptions

func (lib *Library) ProgramOptions() []cel.ProgramOption

type ListLibrary added in v0.8.1

type ListLibrary struct {
}

func (*ListLibrary) CompileOptions added in v0.8.1

func (lib *ListLibrary) CompileOptions() []cel.EnvOption

func (*ListLibrary) LibraryName added in v0.8.1

func (lib *ListLibrary) LibraryName() string

func (*ListLibrary) ProgramOptions added in v0.8.1

func (lib *ListLibrary) ProgramOptions() []cel.ProgramOption

type Location

type Location struct {
	*time.Location
}

func (*Location) ConvertToNative

func (loc *Location) ConvertToNative(typeDesc reflect.Type) (any, error)

func (*Location) ConvertToType

func (loc *Location) ConvertToType(typeValue ref.Type) ref.Val

func (*Location) Equal

func (loc *Location) Equal(other ref.Val) ref.Val

func (*Location) Type

func (loc *Location) Type() ref.Type

func (*Location) Value

func (loc *Location) Value() any

type MetadataLibrary added in v0.10.0

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

func NewMetadataLibrary added in v0.10.0

func NewMetadataLibrary(ctx context.Context) *MetadataLibrary

func (*MetadataLibrary) CompileOptions added in v0.10.0

func (lib *MetadataLibrary) CompileOptions() []cel.EnvOption

func (*MetadataLibrary) LibraryName added in v0.10.0

func (lib *MetadataLibrary) LibraryName() string

func (*MetadataLibrary) ProgramOptions added in v0.10.0

func (lib *MetadataLibrary) ProgramOptions() []cel.ProgramOption

type Rand added in v0.9.0

type Rand struct {
	*rand.Rand
}

func (*Rand) ConvertToNative added in v0.9.0

func (r *Rand) ConvertToNative(typeDesc reflect.Type) (any, error)

func (*Rand) ConvertToType added in v0.9.0

func (r *Rand) ConvertToType(typeValue ref.Type) ref.Val

func (*Rand) Equal added in v0.9.0

func (r *Rand) Equal(other ref.Val) ref.Val

func (*Rand) Type added in v0.9.0

func (r *Rand) Type() ref.Type

func (*Rand) Value added in v0.9.0

func (r *Rand) Value() any

type RandLibrary added in v0.9.0

type RandLibrary struct {
}

func (*RandLibrary) CompileOptions added in v0.9.0

func (lib *RandLibrary) CompileOptions() []cel.EnvOption

func (*RandLibrary) LibraryName added in v0.9.0

func (lib *RandLibrary) LibraryName() string

func (*RandLibrary) ProgramOptions added in v0.9.0

func (lib *RandLibrary) ProgramOptions() []cel.ProgramOption

type ReturnValue added in v0.10.0

type ReturnValue uint64

type Source added in v0.9.0

type Source struct {
	rand.Source
}

func (*Source) ConvertToNative added in v0.9.0

func (s *Source) ConvertToNative(typeDesc reflect.Type) (any, error)

func (*Source) ConvertToType added in v0.9.0

func (s *Source) ConvertToType(typeValue ref.Type) ref.Val

func (*Source) Equal added in v0.9.0

func (s *Source) Equal(other ref.Val) ref.Val

func (*Source) Type added in v0.9.0

func (s *Source) Type() ref.Type

func (*Source) Value added in v0.9.0

func (s *Source) Value() any

type TimeLibrary

type TimeLibrary struct {
}

func (*TimeLibrary) CompileOptions

func (lib *TimeLibrary) CompileOptions() []cel.EnvOption

func (*TimeLibrary) LibraryName

func (lib *TimeLibrary) LibraryName() string

func (*TimeLibrary) ProgramOptions

func (lib *TimeLibrary) ProgramOptions() []cel.ProgramOption

type UUID added in v0.9.0

type UUID struct {
	uuid.UUID
}

func (*UUID) ConvertToNative added in v0.9.0

func (u *UUID) ConvertToNative(typeDesc reflect.Type) (any, error)

func (*UUID) ConvertToType added in v0.9.0

func (u *UUID) ConvertToType(typeValue ref.Type) ref.Val

func (*UUID) Equal added in v0.9.0

func (u *UUID) Equal(other ref.Val) ref.Val

func (*UUID) Type added in v0.9.0

func (u *UUID) Type() ref.Type

func (*UUID) Value added in v0.9.0

func (u *UUID) Value() any

type UUIDLibrary added in v0.9.0

type UUIDLibrary struct {
}

func (*UUIDLibrary) CompileOptions added in v0.9.0

func (lib *UUIDLibrary) CompileOptions() []cel.EnvOption

func (*UUIDLibrary) LibraryName added in v0.9.0

func (lib *UUIDLibrary) LibraryName() string

func (*UUIDLibrary) ProgramOptions added in v0.9.0

func (lib *UUIDLibrary) ProgramOptions() []cel.ProgramOption

type WasmConfig added in v0.10.0

type WasmConfig struct {
	Path   string
	Sha256 string
}

type WasmPlugin added in v0.10.0

type WasmPlugin struct {
	File string
	// contains filtered or unexported fields
}

func NewWasmPlugin added in v0.10.0

func NewWasmPlugin(ctx context.Context, wasmCfg WasmConfig) (*WasmPlugin, error)

func (*WasmPlugin) Call added in v0.10.0

func (p *WasmPlugin) Call(ctx context.Context, fn *CELFunction, md []byte, args ...ref.Val) ref.Val

Jump to

Keyboard shortcuts

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