hooks

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HookConfig

type HookConfig struct {
	Command          string `yaml:"command" json:"command"`
	WorkingDirectory string `yaml:"working_directory,omitempty" json:"working_directory,omitempty"`
	ExitCodes        []int  `yaml:"exit_codes,omitempty" json:"exit_codes,omitempty"`
	ErrorOnFail      bool   `yaml:"error_on_fail,omitempty" json:"error_on_fail,omitempty"`
}

HookConfig defines a single hook command.

type HooksConfig

type HooksConfig struct {
	BeforeRun  []HookConfig `yaml:"before_run,omitempty" json:"before_run,omitempty"`
	AfterRun   []HookConfig `yaml:"after_run,omitempty" json:"after_run,omitempty"`
	BeforeTask []HookConfig `yaml:"before_task,omitempty" json:"before_task,omitempty"`
	AfterTask  []HookConfig `yaml:"after_task,omitempty" json:"after_task,omitempty"`
}

HooksConfig holds all lifecycle hooks.

type Runner

type Runner struct {
	Verbose bool
}

Runner executes hook commands at lifecycle points.

func (*Runner) Execute

func (r *Runner) Execute(ctx context.Context, name string, hooks []HookConfig) error

Execute runs all hooks for a given lifecycle point. name identifies the lifecycle point (e.g. "before_run") for logging and error context.

Jump to

Keyboard shortcuts

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