Adding donut backend and setting as default

This commit is contained in:
Frederick F. Kautz IV
2015-03-23 20:06:15 -07:00
parent 7c1c4b8a02
commit 3c4012f1e7
11 changed files with 254 additions and 34 deletions

View File

@@ -26,6 +26,7 @@ import (
"github.com/minio-io/minio/pkg/api/web"
"github.com/minio-io/minio/pkg/server/httpserver"
mstorage "github.com/minio-io/minio/pkg/storage"
"github.com/minio-io/minio/pkg/storage/donutstorage"
"github.com/minio-io/minio/pkg/storage/file"
"github.com/minio-io/minio/pkg/storage/memory"
)
@@ -138,11 +139,22 @@ func getStorageChannels(storageType StorageType) (ctrlChans []chan<- string, sta
if err != nil {
return nil, nil, nil
}
root := path.Join(u.HomeDir, "minio-storage")
root := path.Join(u.HomeDir, "minio-storage", "file")
ctrlChan, statusChan, storage = file.Start(root)
ctrlChans = append(ctrlChans, ctrlChan)
statusChans = append(statusChans, statusChan)
}
case storageType == Donut:
{
u, err := user.Current()
if err != nil {
return nil, nil, nil
}
root := path.Join(u.HomeDir, "minio-storage", "donut")
ctrlChan, statusChan, storage = donutstorage.Start(root)
ctrlChans = append(ctrlChans, ctrlChan)
statusChans = append(statusChans, statusChan)
}
default: // should never happen
log.Fatal("No storage driver found")
}