mirror of
https://github.com/pgsty/minio.git
synced 2026-08-09 07:43:29 +03:00
Make get/put more robust
- init folder if not present already in 'get()' call
- put.go was referencing wrong args - fix it
- if no OBJECTNAME is specified during 'get' - grab a
list of files under "~/.minio"
- Provide new API GetList() for ObjectStorage struct
This commit is contained in:
@@ -10,6 +10,18 @@ import (
|
||||
"github.com/minio-io/minio/pkgs/storage/fsstorage"
|
||||
)
|
||||
|
||||
func fsGetList(config inputConfig) (io.Reader, error) {
|
||||
var objectStorage storage.ObjectStorage
|
||||
rootDir := path.Join(config.rootDir, config.storageDriver)
|
||||
objectStorage = fsstorage.FileSystemStorage{RootDir: rootDir}
|
||||
objectlist, err := objectStorage.GetList()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
objectListBuffer := bytes.NewBuffer(objectlist)
|
||||
return objectListBuffer, nil
|
||||
}
|
||||
|
||||
func fsGet(config inputConfig, objectPath string) (io.Reader, error) {
|
||||
var objectStorage storage.ObjectStorage
|
||||
rootDir := path.Join(config.rootDir, config.storageDriver)
|
||||
|
||||
Reference in New Issue
Block a user