Documentation
¶
Overview ¶
Package hook provides hook system for hawk-eco. Hooks allow custom commands to run at specific lifecycle points.
Index ¶
- type Dispatcher
- func (d *Dispatcher) DispatchAfterReview(result string) error
- func (d *Dispatcher) DispatchBeforeReview(context string) error
- func (d *Dispatcher) List() map[HookType][]*Hook
- func (d *Dispatcher) LoadHooksFromDir(dir string) error
- func (d *Dispatcher) Register(hookType HookType, hook *Hook)
- func (d *Dispatcher) RegisterBuiltin()
- type Hook
- type HookType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher manages hooks and dispatches them.
func (*Dispatcher) DispatchAfterReview ¶
func (d *Dispatcher) DispatchAfterReview(result string) error
DispatchAfterReview runs hooks after a review.
func (*Dispatcher) DispatchBeforeReview ¶
func (d *Dispatcher) DispatchBeforeReview(context string) error
DispatchBeforeReview runs hooks before a review.
func (*Dispatcher) List ¶
func (d *Dispatcher) List() map[HookType][]*Hook
List returns all registered hooks.
func (*Dispatcher) LoadHooksFromDir ¶
func (d *Dispatcher) LoadHooksFromDir(dir string) error
LoadHooksFromDir loads hooks from a directory.
func (*Dispatcher) Register ¶
func (d *Dispatcher) Register(hookType HookType, hook *Hook)
Register adds a hook for a specific type.
func (*Dispatcher) RegisterBuiltin ¶
func (d *Dispatcher) RegisterBuiltin()
RegisterBuiltin registers default hooks.
type HookType ¶
type HookType string
HookType represents the type of hook.
func HookTypeFromString ¶
HookTypeFromString converts a string to HookType.
Click to show internal directories.
Click to hide internal directories.