NewRegistry returns a registry pre-populated with [HookTypeCommand] (shell command hooks) and [HookTypeBuiltin] (in-process functions).
()
| 93 | // NewRegistry returns a registry pre-populated with [HookTypeCommand] |
| 94 | // (shell command hooks) and [HookTypeBuiltin] (in-process functions). |
| 95 | func NewRegistry() *Registry { |
| 96 | r := &Registry{} |
| 97 | r.Register(HookTypeCommand, newCommandFactory()) |
| 98 | r.Register(HookTypeBuiltin, r.builtinFactory) |
| 99 | return r |
| 100 | } |
| 101 | |
| 102 | // Register associates a factory with a hook type, replacing any prior one. |
| 103 | func (r *Registry) Register(t HookType, f HandlerFactory) { |