Skip to content

Commit

Permalink
add marker and limit
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoushuaime committed Jul 18, 2018
1 parent 8e81f6c commit 9ca381a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions v1/qiniuClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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...
Expand Down

0 comments on commit 9ca381a

Please sign in to comment.