generic

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CELActivation

func CELActivation(dataMap map[string]any, params map[string]any) map[string]any

CELActivation builds the activation map for a resource with params.

func CELVarOpts

func CELVarOpts() []cel.EnvOption

CELVarOpts returns the standard CEL variable options for r, object, and params.

func CelParseParams

func CelParseParams(args []api.FunctionArgument, startIndex int) (map[string]any, error)

CelParseParams extracts key=value params from function arguments starting at the given index and returns them as a map[string]any suitable for CEL evaluation.

func GenericFnDeletePath

func GenericFnDeletePath(resourceProvider yamlkit.ResourceProvider, _ *api.FunctionContext, parsedData gaby.Container, args []api.FunctionArgument) (gaby.Container, any, error)

func GenericFnGetBoolPath

func GenericFnGetBoolPath(resourceProvider yamlkit.ResourceProvider, _ *api.FunctionContext, parsedData gaby.Container, args []api.FunctionArgument) (gaby.Container, any, error)

func GenericFnGetCEL

func GenericFnGetCEL(resourceProvider yamlkit.ResourceProvider, options *api.FunctionOptions, parsedData gaby.Container, args []api.FunctionArgument, extraEnvOpts ...cel.EnvOption) (gaby.Container, any, error)

GenericFnGetCEL implements get-cel extraction. Extra CEL env options can be passed by toolchain-specific overrides.

func GenericFnGetIntPath

func GenericFnGetIntPath(resourceProvider yamlkit.ResourceProvider, _ *api.FunctionContext, parsedData gaby.Container, args []api.FunctionArgument) (gaby.Container, any, error)

func GenericFnGetPath

func GenericFnGetPath(resourceProvider yamlkit.ResourceProvider, _ *api.FunctionContext, parsedData gaby.Container, args []api.FunctionArgument, whereExpressions []*api.VisitorRelationalExpression) (gaby.Container, any, error)

func GenericFnGetStringPath

func GenericFnGetStringPath(resourceProvider yamlkit.ResourceProvider, _ *api.FunctionContext, parsedData gaby.Container, args []api.FunctionArgument) (gaby.Container, any, error)

func GenericFnResourceWhereMatchWithComparators

func GenericFnResourceWhereMatchWithComparators(resourceProvider yamlkit.ResourceProvider, customComparators []api.CustomStringComparator, options *api.FunctionOptions, functionContext *api.FunctionContext, parsedData gaby.Container, args []api.FunctionArgument) (gaby.Container, any, error)

func GenericFnSelectWhereResourceWithComparators

func GenericFnSelectWhereResourceWithComparators(resourceProvider yamlkit.ResourceProvider, customComparators []api.CustomStringComparator, options *api.FunctionOptions, functionContext *api.FunctionContext, parsedData gaby.Container, args []api.FunctionArgument) (gaby.Container, any, error)

func GenericFnSetBoolPath

func GenericFnSetBoolPath(resourceProvider yamlkit.ResourceProvider, _ *api.FunctionContext, parsedData gaby.Container, args []api.FunctionArgument, upsert bool) (gaby.Container, any, error)

func GenericFnSetCEL

func GenericFnSetCEL(resourceProvider yamlkit.ResourceProvider, parsedData gaby.Container, args []api.FunctionArgument, extraEnvOpts ...cel.EnvOption) (gaby.Container, any, error)

GenericFnSetCEL implements set-cel mutation. The CEL expression returns a partial resource map that is merged into the original resource using strategic merge (similar to Kubernetes ApplyConfiguration). Only the fields present in the CEL result are modified; all other fields are preserved. Extra CEL env options can be passed by toolchain-specific overrides.

func GenericFnSetIntPath

func GenericFnSetIntPath(resourceProvider yamlkit.ResourceProvider, _ *api.FunctionContext, parsedData gaby.Container, args []api.FunctionArgument, upsert bool) (gaby.Container, any, error)

func GenericFnSetStringPath

func GenericFnSetStringPath(resourceProvider yamlkit.ResourceProvider, _ *api.FunctionContext, parsedData gaby.Container, args []api.FunctionArgument, upsert bool) (gaby.Container, any, error)

func GenericFnVetCEL

func GenericFnVetCEL(resourceProvider yamlkit.ResourceProvider, options *api.FunctionOptions, parsedData gaby.Container, args []api.FunctionArgument, extraEnvOpts ...cel.EnvOption) (gaby.Container, any, error)

GenericFnVetCEL implements vet-cel validation. Extra CEL env options can be passed by toolchain-specific overrides (e.g., Kubernetes admission policy libraries).

func GenericFnVetJSONSchema

func GenericFnVetJSONSchema(resourceProvider yamlkit.ResourceProvider, options *api.FunctionOptions, _ *api.FunctionContext, parsedData gaby.Container, args []api.FunctionArgument) (gaby.Container, any, error)

func GenericFnVetMergeKeys

func GenericFnVetMergeKeys(resourceProvider yamlkit.ResourceProvider, options *api.FunctionOptions, parsedData gaby.Container) (gaby.Container, any, error)

GenericFnVetMergeKeys checks for duplicate merge keys across all resources.

func GenericVetValues

func GenericVetValues(resourceProvider yamlkit.ResourceProvider, parsedData gaby.Container, attributeName api.AttributeName, filter *api.ValueFilter) (api.ValidationResult, error)

GenericVetValues validates all values at paths registered for the given attribute name against the provided ValueFilter. It is exported so that other functions (e.g. vet-images) can call it.

func NewCELEnv

func NewCELEnv(vars []cel.EnvOption, extraOpts ...cel.EnvOption) (*cel.Env, error)

NewCELEnv creates a CEL environment with the given variables and optional extra options. This provides the base CEL environment used by all generic CEL functions.

func RegisterPathSetterAndGetter

func RegisterPathSetterAndGetter(
	fh handler.FunctionRegistry,
	name string,
	parameters []api.FunctionParameter,
	description string,
	attributeName api.AttributeName,
	resourceProvider yamlkit.ResourceProvider,
	addSetter bool,
	upsert bool,
	defaults bool,
)

func RegisterStandardFunctions

func RegisterStandardFunctions(fh handler.FunctionRegistry, converter configkit.ConfigConverter, resourceProvider yamlkit.ResourceProvider)

Types

This section is empty.

Jump to

Keyboard shortcuts

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