conversion

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedType = errors.New("unsupported type")

ErrUnsupportedType is returned when the type is not supported.

Functions

func GoNativeType

func GoNativeType(v ref.Val) (interface{}, error)

GoNativeType transforms CEL output into corresponding Go types

func IsBoolOrOptionalBool

func IsBoolOrOptionalBool(t *cel.Type) bool

IsBoolOrOptionalBool checks if a CEL type is bool or optional_type(bool). This is useful for validating condition expressions that must return boolean values.

func IsBoolType

func IsBoolType(v ref.Val) bool

IsBoolType checks if the given ref.Val is of type BoolType

func WouldMatchIfUnwrapped

func WouldMatchIfUnwrapped(outputType, expectedType *cel.Type) bool

WouldMatchIfUnwrapped checks if outputType would be assignable to expectedType if we unwrapped the optional wrapper from outputType. This detects the case where outputType is optional_type(T) and expectedType is T.

Types

This section is empty.

Jump to

Keyboard shortcuts

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