|
@@ -134,6 +134,24 @@ func Ls(dir string) ([]string, error) {
|
|
|
return ks, nil
|
|
|
}
|
|
|
|
|
|
+func LsWithoutPrefix(dir string) ([]string, error) {
|
|
|
+ if strutils.HasBlank(dir) {
|
|
|
+ return []string{}, nil
|
|
|
+ }
|
|
|
+
|
|
|
+ v2, err := Bkt.ListObjectsV2(oss.Prefix(dir))
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ ks := make([]string, len(v2.Objects))
|
|
|
+ for i, obj := range v2.Objects {
|
|
|
+ ks[i] = obj.Key
|
|
|
+ }
|
|
|
+
|
|
|
+ return ks, nil
|
|
|
+}
|
|
|
+
|
|
|
type ObjectInfo struct {
|
|
|
Key string
|
|
|
Type string
|