Add a storage prefix flat:// that can handle a flat chunk directory

This commit is contained in:
Gilbert Chen
2017-07-27 22:42:48 -04:00
parent caaff6b4b2
commit 823b82060c
6 changed files with 33 additions and 19 deletions

View File

@@ -95,14 +95,14 @@ func createTestSnapshotManager(testDir string) *SnapshotManager {
os.RemoveAll(testDir)
os.MkdirAll(testDir, 0700)
storage, _ := CreateFileStorage(testDir, 1)
storage, _ := CreateFileStorage(testDir, 2, 1)
storage.CreateDirectory(0, "chunks")
storage.CreateDirectory(0, "snapshots")
config := CreateConfig()
snapshotManager := CreateSnapshotManager(config, storage)
cacheDir := path.Join(testDir, "cache")
snapshotCache, _ := CreateFileStorage(cacheDir, 1)
snapshotCache, _ := CreateFileStorage(cacheDir, 2, 1)
snapshotCache.CreateDirectory(0, "chunks")
snapshotCache.CreateDirectory(0, "snapshots")