Add filesystem factory functions and add related cli options

This commit is contained in:
Harshavardhana
2015-05-30 03:22:25 -07:00
parent 0cc63706bb
commit 82a0eac659
3 changed files with 50 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ import (
"github.com/minio/minio/pkg/iodine"
"github.com/minio/minio/pkg/server/httpserver"
"github.com/minio/minio/pkg/storage/drivers/donut"
fs "github.com/minio/minio/pkg/storage/drivers/fs"
"github.com/minio/minio/pkg/storage/drivers/memory"
"github.com/minio/minio/pkg/utils/log"
)
@@ -47,6 +48,21 @@ func (f MemoryFactory) GetStartServerFunc() StartServerFunc {
}
}
// FilesystemFactory is used to build filesystem api servers
type FilesystemFactory struct {
httpserver.Config
Path string
}
// GetStartServerFunc builds memory api servers
func (f FilesystemFactory) GetStartServerFunc() StartServerFunc {
return func() (chan<- string, <-chan error) {
_, _, driver := fs.Start(f.Path)
ctrl, status, _ := httpserver.Start(api.HTTPHandler(driver), f.Config)
return ctrl, status
}
}
// WebFactory is used to build web cli servers
type WebFactory struct {
httpserver.Config