{"modulePath":"github.com/deckhouse/module-sdk","version":"v0.14.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package executor\n\n## Types\n\n```go\ntype Executor interface {\n\t// Config returns the hook's configuration as HookConfigLike (*HookConfig or *ApplicationHookConfig).\n\tConfig() pkg.HookConfigInterface\n\t// Execute runs the hook logic and returns collected results.\n\tExecute(ctx context.Context, req Request) (Result, error)\n}\n```\nExecutor runs a hook with the provided request and returns results. Implemented by moduleExecutor and applicationExecutor.\n\n```go\nfunc NewApplicationExecutor(h pkg.Hook[pkg.ApplicationHookConfig, *pkg.ApplicationHookInput], logger *log.Logger) Executor\n```\nNewApplicationExecutor creates a new application executor\n\n```go\nfunc NewModuleExecutor(h pkg.Hook[pkg.HookConfig, *pkg.HookInput], logger *log.Logger) Executor\n```\nNewModuleExecutor creates a new module hook executor\n\n```go\ntype Request interface {\n\t// GetValues returns the current module values.\n\tGetValues() (map[string]any, error)\n\t// GetConfigValues returns the module's ConfigMap values.\n\tGetConfigValues() (map[string]any, error)\n\t// GetBindingContexts returns Kubernetes binding contexts with snapshots.\n\tGetBindingContexts() ([]bctx.BindingContext, error)\n\t// GetDependencyContainer returns the container with external dependencies.\n\tGetDependencyContainer() pkg.DependencyContainer\n}\n```\nRequest provides input data for hook execution. Implemented by transport layer (e.g., file transport).\n\n```go\ntype Result interface {\n\t// MetricsCollector returns collected Prometheus metrics.\n\tMetricsCollector() pkg.Outputer\n\t// ObjectPatchCollector returns collected Kubernetes object patches.\n\tObjectPatchCollector() pkg.Outputer\n\t// ValuesPatchCollector returns collected values patches by type.\n\tValuesPatchCollector(key utils.ValuesPatchType) pkg.Outputer\n}\n```\nResult contains outputs collected during hook execution. Used by transport layer to send results back to shell-operator.\n\n","path":"github.com/deckhouse/module-sdk/internal/executor","name":"executor","synopsis":"","isRedistributable":true}
