Skip to content

Commit 0e9536d

Browse files
author
jojoliang
committed
多版本删除
1 parent 0206a7d commit 0e9536d

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

bucket_encryption_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ func TestBucketService_GetEncryption(t *testing.T) {
2121
testFormValues(t, r, vs)
2222
fmt.Fprint(w, `<ServerSideEncryptionConfiguration>
2323
<Rule>
24-
<ApplySideEncryptionConfiguration>
24+
<ApplyServerSideEncryptionByDefault>
2525
<SSEAlgorithm>AES256</SSEAlgorithm>
26-
</ApplySideEncryptionConfiguration>
26+
</ApplyServerSideEncryptionByDefault>
2727
</Rule>
2828
</ServerSideEncryptionConfiguration>`)
2929

cos.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
const (
2424
// Version current go sdk version
25-
Version = "0.7.10"
25+
Version = "0.7.11"
2626
userAgent = "cos-go-sdk-v5/" + Version
2727
contentTypeXML = "application/xml"
2828
defaultServiceBaseURL = "http://service.cos.myqcloud.com"

object.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ type ObjectDeleteOptions struct {
284284
XCosSSECustomerKeyMD5 string `header:"x-cos-server-side-encryption-customer-key-MD5,omitempty" url:"-" xml:"-"`
285285
//兼容其他自定义头部
286286
XOptionHeader *http.Header `header:"-,omitempty" url:"-" xml:"-"`
287+
VersionId string `header:"-" url:"VersionId,omitempty" xml:"-"`
287288
}
288289

289290
// Delete Object请求可以将一个文件(Object)删除。
@@ -304,6 +305,7 @@ func (s *ObjectService) Delete(ctx context.Context, name string, opt ...*ObjectD
304305
uri: "/" + encodeURIComponent(name),
305306
method: http.MethodDelete,
306307
optHeader: optHeader,
308+
optQuery: optHeader,
307309
}
308310
resp, err := s.client.send(ctx, &sendOpt)
309311
return resp, err
@@ -440,9 +442,10 @@ type ObjectDeleteMultiResult struct {
440442
XMLName xml.Name `xml:"DeleteResult"`
441443
DeletedObjects []Object `xml:"Deleted,omitempty"`
442444
Errors []struct {
443-
Key string
444-
Code string
445-
Message string
445+
Key string `xml:",omitempty"`
446+
Code string `xml:",omitempty"`
447+
Message string `xml:",omitempty"`
448+
VersionId string `xml:",omitempty"`
446449
} `xml:"Error,omitempty"`
447450
}
448451

@@ -472,6 +475,7 @@ type Object struct {
472475
LastModified string `xml:",omitempty"`
473476
StorageClass string `xml:",omitempty"`
474477
Owner *Owner `xml:",omitempty"`
478+
VersionId string `xml:",omitempty"`
475479
}
476480

477481
// MultiUploadOptions is the option of the multiupload,

0 commit comments

Comments
 (0)