MCPcopy Create free account
hub / github.com/docker/cli / New

Function New

cli/context/store/store.go:94–107  ·  view source on GitHub ↗

New creates a store from a given directory. If the directory does not exist or is empty, initialize it

(dir string, cfg Config)

Source from the content-addressed store, hash-verified

92// New creates a store from a given directory.
93// If the directory does not exist or is empty, initialize it
94func New(dir string, cfg Config) *ContextStore {
95 metaRoot := filepath.Join(dir, metadataDir)
96 tlsRoot := filepath.Join(dir, tlsDir)
97
98 return &ContextStore{
99 meta: &metadataStore{
100 root: metaRoot,
101 config: cfg,
102 },
103 tls: &tlsStore{
104 root: tlsRoot,
105 },
106 }
107}
108
109// ContextStore implements Store.
110type ContextStore struct {

Callers 8

TestExportImportFunction · 0.70
TestRemoveFunction · 0.70
TestListEmptyStoreFunction · 0.70
TestErrHasCorrectContextFunction · 0.70
TestImportTarInvalidFunction · 0.70
TestImportZipFunction · 0.70
TestImportZipInvalidFunction · 0.70
TestCorruptMetadataFunction · 0.70

Calls

no outgoing calls

Tested by 8

TestExportImportFunction · 0.56
TestRemoveFunction · 0.56
TestListEmptyStoreFunction · 0.56
TestErrHasCorrectContextFunction · 0.56
TestImportTarInvalidFunction · 0.56
TestImportZipFunction · 0.56
TestImportZipInvalidFunction · 0.56
TestCorruptMetadataFunction · 0.56