conversion

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CelValueToGo

func CelValueToGo(val ref.Val) any

CelValueToGo recursively converts a CEL ref.Val to a native Go value. This handles maps, lists, and primitive types.

func GoToCelValue

func GoToCelValue(val any) ref.Val

GoToCelValue converts a native Go value to a CEL ref.Val. This uses the default type adapter to ensure proper conversion.

func ListToObjectSlice

func ListToObjectSlice(listVal ref.Val) ([]map[string]any, error)

ListToObjectSlice converts a CEL list of maps to a Go slice of map[string]any. Returns an error if the list contains non-map elements or if any map has non-string keys.

func ListToStringSlice

func ListToStringSlice(listVal ref.Val) ([]string, error)

ListToStringSlice converts a CEL list to a Go string slice. Returns an error if the list contains non-string elements.

func ToObject

func ToObject(mapVal ref.Val) (map[string]any, error)

ToObject converts a CEL map to a Go map[string]any. Returns an error if the input is not a map or if any key is not a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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