cel

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileExpressionWithEnv

func CompileExpressionWithEnv(expression string, env *cel.Env) (cel.Program, error)

CompileExpressionWithEnv compiles a CEL expression using the provided environment. This is a shared helper that can be reused across different CEL evaluation contexts.

func Evaluate

func Evaluate(expression string, obj client.Object) (any, error)

Evaluate evaluates a CEL expression against a single Kubernetes object. Returns the result of the evaluation.

func EvaluateExpression

func EvaluateExpression(yamlStr string, templateData map[string]any) ([]byte, error)

EvaluateExpression takes a YAML string with ${...} placeholders and evaluates them as CEL expressions.

func EvaluateList

func EvaluateList(expression string, objs []client.Object) ([]any, error)

EvaluateList evaluates a CEL expression against multiple Kubernetes objects. Returns a slice of results, one for each input object.

func EvaluateTyped

func EvaluateTyped[T any](expression string, obj client.Object) (T, error)

EvaluateTyped evaluates a CEL expression against a single Kubernetes object. The result is unmarshalled into the specified generic type T. Returns the result of the evaluation or an error.

func EvaluateWithData

func EvaluateWithData(expression string, env *cel.Env, data map[string]any) (any, error)

EvaluateWithData evaluates a CEL expression against arbitrary data using a custom CEL environment.

Types

This section is empty.

Jump to

Keyboard shortcuts

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