executor

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	// Config returns the hook's configuration as HookConfigLike (*HookConfig or *ApplicationHookConfig).
	Config() pkg.HookConfigInterface
	// Execute runs the hook logic and returns collected results.
	Execute(ctx context.Context, req Request) (Result, error)
}

Executor runs a hook with the provided request and returns results. Implemented by moduleExecutor and applicationExecutor.

func NewApplicationExecutor

func NewApplicationExecutor(h pkg.Hook[pkg.ApplicationHookConfig, *pkg.ApplicationHookInput], logger *log.Logger) Executor

NewApplicationExecutor creates a new application executor

func NewModuleExecutor

func NewModuleExecutor(h pkg.Hook[pkg.HookConfig, *pkg.HookInput], logger *log.Logger) Executor

NewModuleExecutor creates a new module hook executor

type Request

type Request interface {
	// GetValues returns the current module values.
	GetValues() (map[string]any, error)
	// GetConfigValues returns the module's ConfigMap values.
	GetConfigValues() (map[string]any, error)
	// GetBindingContexts returns Kubernetes binding contexts with snapshots.
	GetBindingContexts() ([]bctx.BindingContext, error)
	// GetDependencyContainer returns the container with external dependencies.
	GetDependencyContainer() pkg.DependencyContainer
}

Request provides input data for hook execution. Implemented by transport layer (e.g., file transport).

type Result

type Result interface {
	// MetricsCollector returns collected Prometheus metrics.
	MetricsCollector() pkg.Outputer
	// ObjectPatchCollector returns collected Kubernetes object patches.
	ObjectPatchCollector() pkg.Outputer
	// ValuesPatchCollector returns collected values patches by type.
	ValuesPatchCollector(key utils.ValuesPatchType) pkg.Outputer
}

Result contains outputs collected during hook execution. Used by transport layer to send results back to shell-operator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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