MCPcopy
hub / github.com/perkeep/perkeep / NewDiskStorage

Function NewDiskStorage

pkg/blobserver/proxycache/proxycache_test.go:51–65  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

49)
50
51func NewDiskStorage(t *testing.T) *localdisk.DiskStorage {
52 epochLock.Lock()
53 rootEpoch++
54 path := fmt.Sprintf("%s/camli-testroot-%d-%d", os.TempDir(), os.Getpid(), rootEpoch)
55 rootDir = path
56 epochLock.Unlock()
57 if err := os.Mkdir(path, 0755); err != nil {
58 t.Fatalf("Failed to create temp directory %q: %v", path, err)
59 }
60 ds, err := localdisk.New(path)
61 if err != nil {
62 t.Fatalf("Failed to run New: %v", err)
63 }
64 return ds
65}
66
67const cacheSize = 1 << 20
68

Callers 1

NewProxiedDiskFunction · 0.85

Calls 5

NewFunction · 0.92
LockMethod · 0.80
UnlockMethod · 0.80
FatalfMethod · 0.65
MkdirMethod · 0.45

Tested by

no test coverage detected