Documentation ¶
Index ¶
- func CreateRateLimiter(cfg *config.HookConfig) *rate.Limiter
- func NewHookManager() *hookManager
- type CommonHook
- type Hook
- func (h *Hook) GetConfig() *config.HookConfig
- func (h *Hook) GetConfigDescription() string
- func (h *Hook) LoadConfig(configOutput []byte) (hook *Hook, err error)
- func (h *Hook) RateLimitWait(ctx context.Context) error
- func (h *Hook) Run(bindingType BindingType, context []BindingContext, logLabels map[string]string) (*HookResult, error)
- func (h *Hook) SafeName() string
- func (h *Hook) WithHookController(hookController controller.HookController)
- func (h *Hook) WithTmpDir(dir string)
- type HookManager
- type HookResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRateLimiter ¶
func CreateRateLimiter(cfg *config.HookConfig) *rate.Limiter
func NewHookManager ¶
func NewHookManager() *hookManager
Types ¶
type CommonHook ¶
type CommonHook interface {
Name() string
}
type Hook ¶
type Hook struct { Name string // The unique name like '002-prometheus-hooks/startup_hook'. Path string // The absolute path to the executable file. Config *config.HookConfig HookController controller.HookController RateLimiter *rate.Limiter TmpDir string }
func (*Hook) GetConfig ¶
func (h *Hook) GetConfig() *config.HookConfig
func (*Hook) GetConfigDescription ¶
func (*Hook) Run ¶
func (h *Hook) Run(bindingType BindingType, context []BindingContext, logLabels map[string]string) (*HookResult, error)
func (*Hook) WithHookController ¶
func (h *Hook) WithHookController(hookController controller.HookController)
func (*Hook) WithTmpDir ¶
type HookManager ¶
type HookManager interface { Init() error Run() WithDirectories(workingDir string, tempDir string) WithKubeEventManager(kube_events_manager.KubeEventsManager) WithScheduleManager(schedule_manager.ScheduleManager) WithConversionWebhookManager(*conversion.WebhookManager) WithValidatingWebhookManager(*validating.WebhookManager) WorkingDir() string TempDir() string GetHook(name string) *Hook GetHookNames() []string GetHooksInOrder(bindingType BindingType) ([]string, error) HandleKubeEvent(kubeEvent KubeEvent, createTaskFn func(*Hook, controller.BindingExecutionInfo)) HandleScheduleEvent(crontab string, createTaskFn func(*Hook, controller.BindingExecutionInfo)) HandleValidatingEvent(event ValidatingEvent, createTaskFn func(*Hook, controller.BindingExecutionInfo)) HandleConversionEvent(event conversion.Event, rule conversion.Rule, createTaskFn func(*Hook, controller.BindingExecutionInfo)) FindConversionChain(crdName string, rule conversion.Rule) []conversion.Rule }
type HookResult ¶
type HookResult struct { Usage *executor.CmdUsage Metrics []operation.MetricOperation ConversionResponse *conversion.Response ValidatingResponse *ValidatingResponse KubernetesPatchBytes []byte }
Click to show internal directories.
Click to hide internal directories.