阿里云oss
This commit is contained in:
@@ -25,19 +25,19 @@ func TestALiYunOSSClient_NewAliYunOSS(t *testing.T) {
|
||||
t.Log(client.ossClient)
|
||||
}
|
||||
|
||||
func TestALiYunOSSClient_GetSignUrl(t *testing.T) {
|
||||
func TestALiYunOSSClient_BuildPutSignUrl(t *testing.T) {
|
||||
err := client.NewAliYunOSS()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
sign, err := client.GetPutSignUrl("", "test/upload/bizhi1.jpg", 0)
|
||||
sign, err := client.BuildPutSignUrl("", "test/upload/bizhi1.jpg", 0)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
t.Log(sign)
|
||||
}
|
||||
|
||||
func TestALiYunOSSClient_GetSignUrlByPutObjectRequest(t *testing.T) {
|
||||
func TestALiYunOSSClient_BuildPutSignUrlByPutObjectRequest(t *testing.T) {
|
||||
err := client.NewAliYunOSS()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
@@ -46,7 +46,7 @@ func TestALiYunOSSClient_GetSignUrlByPutObjectRequest(t *testing.T) {
|
||||
req.Bucket = oss.Ptr("")
|
||||
req.Key = oss.Ptr("test/upload/bizhi2.jpg")
|
||||
req.ContentType = oss.Ptr("application/octet-stream")
|
||||
sign, err := client.GetPutSignUrlByPutObjectRequest(req, 0)
|
||||
sign, err := client.BuildPutSignUrlByPutObjectRequest(req, 0)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -65,7 +65,7 @@ func TestALiYunOSSClient_PutForLocalFile(t *testing.T) {
|
||||
t.Log(result)
|
||||
}
|
||||
|
||||
func TestALiYunOSSClient_GetSignUrlByGetObjectRequest(t *testing.T) {
|
||||
func TestALiYunOSSClient_BuildSignUrlByGetObjectRequest(t *testing.T) {
|
||||
err := client.NewAliYunOSS()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
@@ -73,7 +73,7 @@ func TestALiYunOSSClient_GetSignUrlByGetObjectRequest(t *testing.T) {
|
||||
req := &oss.GetObjectRequest{}
|
||||
req.Bucket = oss.Ptr("ssgfdown")
|
||||
req.Key = oss.Ptr("test/upload/bizhi2.jpg")
|
||||
result, err := client.GetSignUrlByGetObjectRequest(req)
|
||||
result, err := client.BuildSignUrlByGetObjectRequest(req)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user