From 9ca381ab92bfd0852e053e277e8af66507047ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E5=B8=85?= <571840649@qq.com> Date: Wed, 18 Jul 2018 16:01:16 +0800 Subject: [PATCH] add marker and limit --- v1/qiniuClient.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/v1/qiniuClient.go b/v1/qiniuClient.go index bb8f5a6..b2b1ed7 100644 --- a/v1/qiniuClient.go +++ b/v1/qiniuClient.go @@ -39,7 +39,7 @@ func UploadFileToQiniu(localFile, bucket, key, accessKey, secretKey string) (sto } // GetQiniuFileList Get file from Qiniu... -func GetQiniuFileList(bucket, accessKey, secretKey string) ([]storage.ListItem, error) { +func GetQiniuFileList(bucket, accessKey, secretKey, marker string, limit int) ([]storage.ListItem, string, error) { qb := &qbox.Mac{ AccessKey: accessKey, SecretKey: []byte(secretKey), @@ -49,12 +49,12 @@ func GetQiniuFileList(bucket, accessKey, secretKey string) ([]storage.ListItem, cfg.UseHTTPS = false cfg.UseCdnDomains = false r := storage.NewBucketManager(qb, &cfg) - f, _, _, _, err := r.ListFiles(bucket, "", "", "", 1000) + f, _, marker, _, err := r.ListFiles(bucket, "", "", marker, limit) if err != nil { log.Fatalf("获取空间文件列表失败", err) - return f, err + return f, "", err } - return f, nil + return f, marker, nil } // DeleteOneFileFromQiniu Delete file from Qiniu...