3 Commits

Author SHA1 Message Date
agin719
2c06d5299e Merge pull request #100 from agin719/cos-v4-dev
update upload
2021-01-11 07:37:06 -06:00
jojoliang
c403391509 update upload 2021-01-11 21:29:34 +08:00
gouki0123
5172396831 Updated CHANGELOG.md 2020-12-29 10:57:52 +00:00
4 changed files with 15 additions and 3 deletions

View File

@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
## [v0.7.17](https://github.com/tencentyun/cos-go-sdk-v5/compare/v0.7.16...v0.7.17) - 2020-12-29
add multicopy
### Merged
- add MultiCopy [`#99`](https://github.com/tencentyun/cos-go-sdk-v5/pull/99)
### Commits
- Updated CHANGELOG.md [`91fc87b`](https://github.com/tencentyun/cos-go-sdk-v5/commit/91fc87ba8af042adb0d0bf147f8fe6aa49057976)
## [v0.7.16](https://github.com/tencentyun/cos-go-sdk-v5/compare/v0.7.15...v0.7.16) - 2020-12-24
add bucket accelerate && update upload progress

2
cos.go
View File

@@ -22,7 +22,7 @@ import (
const (
// Version current go sdk version
Version = "0.7.17"
Version = "0.7.18"
userAgent = "cos-go-sdk-v5/" + Version
contentTypeXML = "application/xml"
defaultServiceBaseURL = "http://service.cos.myqcloud.com"

View File

@@ -113,7 +113,7 @@ func decodeURIComponent(s string) (string, error) {
}
func DecodeURIComponent(s string) (string, error) {
return DecodeURIComponent(s)
return decodeURIComponent(s)
}
func EncodeURIComponent(s string) string {

View File

@@ -563,12 +563,12 @@ func worker(s *ObjectService, jobs <-chan *Jobs, results chan<- *Results) {
results <- &res
}
fd.Seek(j.Chunk.OffSet, os.SEEK_SET)
// UploadPart do not support the chunk trsf, so need to add the content-length
j.Opt.ContentLength = int(j.Chunk.Size)
rt := j.RetryTimes
for {
fd.Seek(j.Chunk.OffSet, os.SEEK_SET)
resp, err := s.UploadPart(context.Background(), j.Name, j.UploadId, j.Chunk.Number,
&io.LimitedReader{R: fd, N: j.Chunk.Size}, j.Opt)
res.PartNumber = j.Chunk.Number