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

Function WithFetcher

pkg/modelsdev/store.go:79–83  ·  view source on GitHub ↗

WithFetcher overrides the function used to fetch the catalog from the network. It is primarily a test seam: callers can stub the network out (and observe whether a fetch was attempted) without mutating package-level state, which keeps such tests safe to run in parallel.

(fn fetcher)

Source from the content-addressed store, hash-verified

77// (and observe whether a fetch was attempted) without mutating package-level
78// state, which keeps such tests safe to run in parallel.
79func WithFetcher(fn fetcher) Opt {
80 return func(o *storeOptions) {
81 o.fetch = fn
82 }
83}
84
85// WithKnownProvider restricts which provider names may trigger an outbound
86// fetch of the models.dev catalog. The predicate should report whether a

Calls

no outgoing calls