Skip to content

Commit

Permalink
多版本删除
Browse files Browse the repository at this point in the history
  • Loading branch information
jojoliang committed Sep 27, 2020
1 parent 0206a7d commit 0e9536d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bucket_encryption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func TestBucketService_GetEncryption(t *testing.T) {
testFormValues(t, r, vs)
fmt.Fprint(w, `<ServerSideEncryptionConfiguration>
<Rule>
<ApplySideEncryptionConfiguration>
<ApplyServerSideEncryptionByDefault>
<SSEAlgorithm>AES256</SSEAlgorithm>
</ApplySideEncryptionConfiguration>
</ApplyServerSideEncryptionByDefault>
</Rule>
</ServerSideEncryptionConfiguration>`)

Expand Down
2 changes: 1 addition & 1 deletion cos.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

const (
// Version current go sdk version
Version = "0.7.10"
Version = "0.7.11"
userAgent = "cos-go-sdk-v5/" + Version
contentTypeXML = "application/xml"
defaultServiceBaseURL = "http://service.cos.myqcloud.com"
Expand Down
10 changes: 7 additions & 3 deletions object.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ type ObjectDeleteOptions struct {
XCosSSECustomerKeyMD5 string `header:"x-cos-server-side-encryption-customer-key-MD5,omitempty" url:"-" xml:"-"`
//兼容其他自定义头部
XOptionHeader *http.Header `header:"-,omitempty" url:"-" xml:"-"`
VersionId string `header:"-" url:"VersionId,omitempty" xml:"-"`
}

// Delete Object请求可以将一个文件(Object)删除。
Expand All @@ -304,6 +305,7 @@ func (s *ObjectService) Delete(ctx context.Context, name string, opt ...*ObjectD
uri: "/" + encodeURIComponent(name),
method: http.MethodDelete,
optHeader: optHeader,
optQuery: optHeader,
}
resp, err := s.client.send(ctx, &sendOpt)
return resp, err
Expand Down Expand Up @@ -440,9 +442,10 @@ type ObjectDeleteMultiResult struct {
XMLName xml.Name `xml:"DeleteResult"`
DeletedObjects []Object `xml:"Deleted,omitempty"`
Errors []struct {
Key string
Code string
Message string
Key string `xml:",omitempty"`
Code string `xml:",omitempty"`
Message string `xml:",omitempty"`
VersionId string `xml:",omitempty"`
} `xml:"Error,omitempty"`
}

Expand Down Expand Up @@ -472,6 +475,7 @@ type Object struct {
LastModified string `xml:",omitempty"`
StorageClass string `xml:",omitempty"`
Owner *Owner `xml:",omitempty"`
VersionId string `xml:",omitempty"`
}

// MultiUploadOptions is the option of the multiupload,
Expand Down

0 comments on commit 0e9536d

Please sign in to comment.