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

Struct lazyModelStore

pkg/runtime/lazy_model_store.go:26–30  ·  view source on GitHub ↗

lazyModelStore is the default ModelStore wired in when the caller did not pass WithModelStore. It defers constructing the modelsdev store (which calls os.UserHomeDir and creates the ~/.cagent cache directory) until the first method invocation. This keeps NewLocalRuntime free of disk I/O — tests that

Source from the content-addressed store, hash-verified

24// Each runtime gets its own *Store; the per-runtime sync.Once only defers
25// construction, it does not share catalog state across runtimes.
26type lazyModelStore struct {
27 once sync.Once
28 st *modelsdev.Store
29 err error
30}
31
32func (l *lazyModelStore) load() (*modelsdev.Store, error) {
33 l.once.Do(func() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected