mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Add filesystem factory functions and add related cli options
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user