cel

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const Language = "cel"

Variables

View Source
var ErrorType = cel.ObjectType("error")
View Source
var TypeAdapter = &adapter{}

Functions

func NewCompiler

func NewCompiler(opts ...cel.EnvOption) language.Compiler

Types

type Error

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

Error represents an error type that wraps a generic error.

func (*Error) ConvertToNative

func (e *Error) ConvertToNative(typeDesc reflect.Type) (any, error)

ConvertToNative converts the Error instance to a syscall Go type as per the provided type descriptor.

func (*Error) ConvertToType

func (e *Error) ConvertToType(typeVal ref.Type) ref.Val

ConvertToType converts the Error instance to a specified ref.Type value.

func (*Error) Equal

func (e *Error) Equal(other ref.Val) ref.Val

Equal checks equality between the Error instance and another ref.Val instance.

func (*Error) Is

func (e *Error) Is(target error) bool

Is checks whether the Error instance matches the target error using errors.Is.

func (*Error) String

func (e *Error) String() string

String returns the string representation of the Error instance.

func (*Error) Type

func (e *Error) Type() ref.Type

Type returns the ref.Type descriptor for the Error instance.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap returns the wrapped error instance from the Error.

func (*Error) Value

func (e *Error) Value() any

Value returns the underlying value of the Error instance.