MCPcopy
hub / github.com/perkeep/perkeep / New

Function New

pkg/blobserver/dir/dir.go:30–42  ·  view source on GitHub ↗

New returns a new blobserver Storage implementation, storing blobs in the provided dir. If dir has an index.kv file, a diskpacked implementation is returned.

(dir string)

Source from the content-addressed store, hash-verified

28// New returns a new blobserver Storage implementation, storing blobs in the provided dir.
29// If dir has an index.kv file, a diskpacked implementation is returned.
30func New(dir string) (blobserver.Storage, error) {
31 if v, err := diskpacked.IsDir(dir); err != nil {
32 return nil, err
33 } else if v {
34 return diskpacked.New(dir)
35 }
36 if v, err := localdisk.IsDir(dir); err != nil {
37 return nil, err
38 } else if v {
39 return localdisk.New(dir)
40 }
41 return diskpacked.New(dir)
42}

Callers 1

newUploaderFunction · 0.92

Calls 4

IsDirFunction · 0.92
NewFunction · 0.92
IsDirFunction · 0.92
NewFunction · 0.92

Tested by

no test coverage detected