Versions in this module Expand all Collapse all v1 v1.23.14 Apr 4, 2026 Changes in this version + type HooksConfig map[string][]*HookConfig + func (ch *HooksConfig) UnmarshalYAML(unmarshal func(any) error) error + func (ch HooksConfig) MarshalYAML() (any, error) v1.23.13 Mar 26, 2026 Changes in this version + const HookPlatformPosix + const HookPlatformWindows + const HookTypeNone + const HookTypePost + const HookTypePre + const ScriptLocationInline + const ScriptLocationPath + const ScriptLocationUnknown + const ScriptTypeUnknown + const ShellTypeBash + const ShellTypePowershell + var ErrInvalidEvent = errors.New("invalid event name for the current type") + var ErrRunRequired error = errors.New("run is always required") + var ErrScriptTypeUnknown error = errors.New(...) + var ErrUnsupportedScriptType error = errors.New("script type is not valid. Only '.sh' and '.ps1' are supported") + type Event string + type EventDispatcher struct + func NewEventDispatcher[T any](validEventNames ...Event) *EventDispatcher[T] + func (ed *EventDispatcher[T]) AddHandler(ctx context.Context, name Event, handler EventHandlerFn[T]) error + func (ed *EventDispatcher[T]) Invoke(ctx context.Context, name Event, eventArgs T, action InvokeFn) error + func (ed *EventDispatcher[T]) RaiseEvent(ctx context.Context, name Event, eventArgs T) error + func (ed *EventDispatcher[T]) RemoveHandler(ctx context.Context, name Event, handler EventHandlerFn[T]) error + type EventHandlerFn func(ctx context.Context, args T) error + type HookConfig struct + ContinueOnError bool + Interactive bool + Name string + Posix *HookConfig + Run string + Secrets map[string]string + Shell ShellType + Windows *HookConfig + func (hc *HookConfig) IsPowerShellHook() bool + func (hc *HookConfig) IsUsingDefaultShell() bool + type HookFilterPredicateFn func(scriptName string, hookConfig *HookConfig) bool + type HookPlatformType string + type HookType string + func InferHookType(name string) (HookType, string) + type HookValidationResult struct + Warnings []HookWarning + type HookWarning struct + Message string + Suggestion string + type HooksManager struct + func NewHooksManager(cwd string, commandRunner exec.CommandRunner) *HooksManager + func (h *HooksManager) GetAll(hooks map[string][]*HookConfig) ([]*HookConfig, error) + func (h *HooksManager) GetByParams(hooks map[string][]*HookConfig, prefix HookType, commands ...string) ([]*HookConfig, error) + func (h *HooksManager) ValidateHooks(ctx context.Context, allHooks map[string][]*HookConfig) *HookValidationResult + type HooksRunner struct + func NewHooksRunner(hooksManager *HooksManager, commandRunner exec.CommandRunner, ...) *HooksRunner + func (h *HooksRunner) GetScript(hookConfig *HookConfig, envVars []string) (tools.Script, error) + func (h *HooksRunner) Invoke(ctx context.Context, commands []string, actionFn InvokeFn) error + func (h *HooksRunner) RunHooks(ctx context.Context, hookType HookType, options *tools.ExecOptions, ...) error + type InvokeFn func() error + type ScriptLocation string + type ShellType string