MCPcopy Index your code
hub / github.com/docker/docker-agent / WithHooksRegistry

Function WithHooksRegistry

pkg/runtime/runtime.go:546–552  ·  view source on GitHub ↗

WithHooksRegistry plugs a pre-populated [hooks.Registry] into the runtime instead of letting it allocate a fresh one. Embedders use this to pre-register builtins they own (today snapshot, tomorrow any custom builtin) so the auto-injection chain set up by [WithAutoInjector] resolves against the same

(reg *hooks.Registry)

Source from the content-addressed store, hash-verified

544// unload, ...) on top of the supplied registry, so the embedder only
545// needs to install entries that the runtime can't construct itself.
546func WithHooksRegistry(reg *hooks.Registry) Opt {
547 return func(r *LocalRuntime) {
548 if reg != nil {
549 r.hooksRegistry = reg
550 }
551 }
552}
553
554// New creates a runtime ready to drive an agent loop. It is a thin
555// alias for [NewLocalRuntime] returning the [Runtime] interface, kept

Callers 1

snapshotRuntimeOptsMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected