minio recurse support
parent
7c9b1c38fb
commit
dab532e7f0
|
|
@ -0,0 +1,5 @@
|
|||
package storage
|
||||
|
||||
import "local/storage/minio"
|
||||
|
||||
type Minio minio.Minio
|
||||
|
|
@ -13,8 +13,9 @@ import (
|
|||
)
|
||||
|
||||
type Minio struct {
|
||||
db *minio.Client
|
||||
ListTimestamps bool
|
||||
db *minio.Client
|
||||
ListTimestamps bool
|
||||
NoRecursiveList bool
|
||||
}
|
||||
|
||||
func NewMinio(addr, user, pass string) (*Minio, error) {
|
||||
|
|
@ -34,7 +35,7 @@ func (m *Minio) List(ns []string, limits ...string) ([]string, error) {
|
|||
defer close(done)
|
||||
keys := []string{}
|
||||
prefix := commonSubstr(limits[:2])
|
||||
for resp := range m.db.ListObjects(namespace, prefix, true, done) {
|
||||
for resp := range m.db.ListObjects(namespace, prefix, !m.NoRecursiveList, done) {
|
||||
if resp.Err != nil {
|
||||
return keys, resp.Err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue