utils

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgumentsAsCelEnv added in v0.5.0

func ArgumentsAsCelEnv(arguments map[string]base.AttributeType) (*cel.Env, error)

ArgumentsAsCelEnv converts a map of attributes to a CEL environment. It iterates through the map, retrieves the CEL type for each attribute, and appends it to an array of CEL environment options.

func ConvertProtoAnyToInterface added in v0.5.0

func ConvertProtoAnyToInterface(a *anypb.Any) interface{}

ConvertProtoAnyToInterface unmarshal a proto Any message into its specific type based on its TypeUrl. It returns the data contained in the proto message as an interface{}. In case of an error during unmarshalling or an unrecognized TypeUrl, it returns a default value.

func GetCelType added in v0.5.0

func GetCelType(attributeType base.AttributeType) (*types.Type, error)

GetCelType maps a base.AttributeType to its equivalent CEL type. Returns an error if the attribute type is not recognized.

func Key

func Key(v1, v2 string) string

Key concatenates two strings v1 and v2 with a "#" in between and returns the result.

Types

This section is empty.

Jump to

Keyboard shortcuts

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