|
|
|
@@ -39,6 +39,31 @@ func Test_Presigned(t *testing.T) { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
func Test_PresignedObjectListByPath(t *testing.T) { |
|
|
|
cli := NewClient(&Config{ |
|
|
|
URL: "http://localhost:7890", |
|
|
|
AccessKey: "123456", |
|
|
|
SecretKey: "123456", |
|
|
|
}) |
|
|
|
|
|
|
|
Convey("下载文件", t, func() { |
|
|
|
pre := cli.Presigned() |
|
|
|
url, err := pre.ObjectListByPath(PresignedObjectListByPath{ |
|
|
|
ObjectListByPath: ObjectListByPath{ |
|
|
|
UserID: 1, |
|
|
|
PackageID: 12, |
|
|
|
Path: "a/", |
|
|
|
IsPrefix: true, |
|
|
|
NoRecursive: true, |
|
|
|
MaxKeys: 10, |
|
|
|
ContinuationToken: "123456", |
|
|
|
}, |
|
|
|
}, 100) |
|
|
|
So(err, ShouldEqual, nil) |
|
|
|
t.Logf("url: %s", url) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
func Test_PresignedObjectDownloadByPath(t *testing.T) { |
|
|
|
cli := NewClient(&Config{ |
|
|
|
URL: "http://localhost:7890", |
|
|
|
|