Documentation ¶
Index ¶
- type GoHook
- func (h *GoHook) AddMetadata(meta *go_hook.HookMetadata)
- func (h *GoHook) BackportHookConfig(cfg *config.HookConfig)
- func (h *GoHook) Execute(_ string, bContext []binding_context.BindingContext, _ string, ...) (result *HookResult, err error)
- func (h *GoHook) GetBasicHook() sh_hook.Hook
- func (h *GoHook) GetConfig() *go_hook.HookConfig
- func (h *GoHook) GetHookConfigDescription() string
- func (h *GoHook) GetHookController() *controller.HookController
- func (h *GoHook) GetKind() HookKind
- func (h *GoHook) GetName() string
- func (h *GoHook) GetPath() string
- func (h *GoHook) RateLimitWait(ctx context.Context) error
- func (h *GoHook) Run(input *go_hook.HookInput) error
- func (h *GoHook) WithHookController(hookController *controller.HookController)
- func (h *GoHook) WithTmpDir(tmpDir string)
- type HookKind
- type HookResult
- type ReconcileFunc
- type ShellHook
- func (sh *ShellHook) BackportHookConfig(cfg *config.HookConfig)
- func (sh *ShellHook) Execute(configVersion string, bContext []binding_context.BindingContext, ...) (result *HookResult, err error)
- func (sh *ShellHook) GetConfig() ([]byte, error)
- func (sh *ShellHook) GetHookConfigDescription() string
- func (sh *ShellHook) GetHookController() *controller.HookController
- func (sh *ShellHook) GetKind() HookKind
- func (sh *ShellHook) GetName() string
- func (sh *ShellHook) GetPath() string
- func (sh *ShellHook) WithHookController(hookController *controller.HookController)
- func (sh *ShellHook) WithTmpDir(tmpDir string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoHook ¶
type GoHook struct {
// contains filtered or unexported fields
}
func NewGoHook ¶
func NewGoHook(config *go_hook.HookConfig, f ReconcileFunc) *GoHook
NewGoHook creates a new go hook
func (*GoHook) AddMetadata ¶
func (h *GoHook) AddMetadata(meta *go_hook.HookMetadata)
AddMetadata add hook metadata, name and path which are resolved by SDK registry
func (*GoHook) BackportHookConfig ¶
func (h *GoHook) BackportHookConfig(cfg *config.HookConfig)
BackportHookConfig passes config for shell-operator to make HookController and GetConfigDescription workable.
func (*GoHook) Execute ¶
func (h *GoHook) Execute(_ string, bContext []binding_context.BindingContext, _ string, configValues, values utils.Values, logLabels map[string]string) (result *HookResult, err error)
Execute runs the hook and return the result of the execution
func (*GoHook) GetBasicHook ¶
GetBasicHook returns hook for shell-operator Deprecated: don't use it for production purposes. You don't need such a low level for working with hooks
func (*GoHook) GetConfig ¶
func (h *GoHook) GetConfig() *go_hook.HookConfig
GetConfig returns hook config, which was set by user, while defining the hook
func (*GoHook) GetHookConfigDescription ¶
GetHookConfigDescription get part of hook config for logging/debugging
func (*GoHook) GetHookController ¶
func (h *GoHook) GetHookController() *controller.HookController
GetHookController returns HookController
func (*GoHook) RateLimitWait ¶
RateLimitWait runs query rate limiter pause
func (*GoHook) WithHookController ¶
func (h *GoHook) WithHookController(hookController *controller.HookController)
WithHookController sets dependency "hook controller" for shell-operator
func (*GoHook) WithTmpDir ¶
WithTmpDir injects temp directory from operator
type HookResult ¶
type HookResult struct { Usage *executor.CmdUsage Patches map[utils.ValuesPatchType]*utils.ValuesPatch Metrics []metric_operation.MetricOperation ObjectPatcherOperations []object_patch.Operation BindingActions []go_hook.BindingAction }
HookResult returns result of a hook execution
type ReconcileFunc ¶
ReconcileFunc function which holds the main logic of the hook
type ShellHook ¶
func NewShellHook ¶
NewShellHook new hook, which runs via the OS interpreter like bash/python/etc
func (*ShellHook) BackportHookConfig ¶
func (sh *ShellHook) BackportHookConfig(cfg *config.HookConfig)
BackportHookConfig for shell-operator to make HookController and GetConfigDescription workable.
func (*ShellHook) Execute ¶
func (sh *ShellHook) Execute(configVersion string, bContext []binding_context.BindingContext, moduleSafeName string, configValues, values utils.Values, logLabels map[string]string) (result *HookResult, err error)
Execute runs the hook via the OS interpreter and returns the result of the execution
func (*ShellHook) GetHookConfigDescription ¶
GetHookConfigDescription get part of hook config for logging/debugging
func (*ShellHook) GetHookController ¶
func (sh *ShellHook) GetHookController() *controller.HookController
GetHookController returns HookController
func (*ShellHook) WithHookController ¶
func (sh *ShellHook) WithHookController(hookController *controller.HookController)
WithHookController sets dependency "hook controller" for shell-operator
func (*ShellHook) WithTmpDir ¶
WithTmpDir injects temp directory from operator