mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
Add list() object support for erasure and append storage drivers
- Reply back objects with their protectionlevel and md5sum - // TODO hash value - Calculate md5sum after "storeBlocks()", to make sure data is committed
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
@@ -11,8 +12,23 @@ import (
|
||||
)
|
||||
|
||||
func erasureGetList(config inputConfig) (io.Reader, error) {
|
||||
// do nothing
|
||||
return nil, errors.New("Not Implemented")
|
||||
var objectStorage storage.ObjectStorage
|
||||
rootDir := path.Join(config.rootDir, config.storageDriver)
|
||||
objectStorage, err := es.NewStorage(rootDir, config.k, config.m, config.blockSize)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
objectDescList, err := objectStorage.List()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var objectDescListBytes []byte
|
||||
if objectDescListBytes, err = json.Marshal(objectDescList); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
objectDescListBuffer := bytes.NewBuffer(objectDescListBytes)
|
||||
|
||||
return objectDescListBuffer, nil
|
||||
}
|
||||
|
||||
func erasureGet(config inputConfig, objectPath string) (io.Reader, error) {
|
||||
|
||||
@@ -15,7 +15,7 @@ func fsGetList(config inputConfig) (io.Reader, error) {
|
||||
var objectStorage storage.ObjectStorage
|
||||
rootDir := path.Join(config.rootDir, config.storageDriver)
|
||||
objectStorage, _ = fsstorage.NewStorage(rootDir)
|
||||
objectList, err := objectStorage.List("/")
|
||||
objectList, err := objectStorage.List()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user