minio recurse support

master
Bel LaPointe 2021-07-17 11:15:31 -06:00
parent 7c9b1c38fb
commit dab532e7f0
2 changed files with 9 additions and 3 deletions

5
minio.go Normal file
View File

@ -0,0 +1,5 @@
package storage
import "local/storage/minio"
type Minio minio.Minio

View File

@ -13,8 +13,9 @@ import (
) )
type Minio struct { type Minio struct {
db *minio.Client db *minio.Client
ListTimestamps bool ListTimestamps bool
NoRecursiveList bool
} }
func NewMinio(addr, user, pass string) (*Minio, error) { 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) defer close(done)
keys := []string{} keys := []string{}
prefix := commonSubstr(limits[:2]) 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 { if resp.Err != nil {
return keys, resp.Err return keys, resp.Err
} }