Documentation
¶
Index ¶
- func CompileExpressionWithEnv(expression string, env *cel.Env) (cel.Program, error)
- func Evaluate(expression string, obj client.Object) (any, error)
- func EvaluateExpression(yamlStr string, templateData map[string]any) ([]byte, error)
- func EvaluateList(expression string, objs []client.Object) ([]any, error)
- func EvaluateProgram(prg cel.Program, data map[string]any) (any, error)
- func EvaluateTyped[T any](expression string, obj client.Object) (T, error)
- func EvaluateWithData(expression string, env *cel.Env, data map[string]any) (any, error)
- func StructToMap(v any) (map[string]any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompileExpressionWithEnv ¶
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 ¶
Evaluate evaluates a CEL expression against a single Kubernetes object. Returns the result of the evaluation.
func EvaluateExpression ¶
EvaluateExpression takes a YAML string with ${...} placeholders and evaluates them as CEL expressions.
func EvaluateList ¶
EvaluateList evaluates a CEL expression against multiple Kubernetes objects. Returns a slice of results, one for each input object.
func EvaluateProgram ¶ added in v0.18.0
EvaluateProgram evaluates an already compiled CEL program against the given data.
func EvaluateTyped ¶
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 ¶
EvaluateWithData evaluates a CEL expression against arbitrary data using a custom CEL environment.
Types ¶
This section is empty.