diff --git a/.travis.yml b/.travis.yml index 5202cd9..c9643c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,8 @@ go: - '1.8' - '1.9' - 1.10.x +- 1.11.x +- 1.12.x - master sudo: false before_install: @@ -15,8 +17,8 @@ install: - go build github.com/mattn/goveralls script: - make test -- make ci-test -- go test -coverprofile=cover.out github.com/toranger/cos-go-sdk-v5 +# - make ci-test +# - go test -coverprofile=cover.out github.com/toranger/cos-go-sdk-v5 - "${TRAVIS_HOME}/gopath/bin/goveralls -service=travis-ci -coverprofile=cover.out" matrix: allow_failures: diff --git a/auth_test.go b/auth_test.go index bf1b6c5..e735e5b 100644 --- a/auth_test.go +++ b/auth_test.go @@ -45,7 +45,10 @@ func TestAuthorizationTransport(t *testing.T) { } }) - client.client.Transport = &AuthorizationTransport{} + client.client.Transport = &AuthorizationTransport{ + SecretID: "test", + SecretKey: "test", + } req, _ := http.NewRequest("GET", client.BaseURL.BucketURL.String(), nil) client.doAPI(context.Background(), req, nil, true) } diff --git a/costesting/ci_test.go b/costesting/ci_test.go index 90a7e67..8532117 100644 --- a/costesting/ci_test.go +++ b/costesting/ci_test.go @@ -6,7 +6,7 @@ import ( "fmt" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - "github.com/toranger/cos-go-sdk-v5" + "github.com/tencentyun/cos-go-sdk-v5" "io/ioutil" "math/rand" "net/http" diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..35afc5c --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module github.com/tencentyun/cos-go-sdk-v5 + +go 1.12 + +require ( + github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409 + github.com/google/go-querystring v1.0.0 + github.com/mozillazg/go-httpheader v0.2.1 + github.com/stretchr/testify v1.3.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..5ee5a1d --- /dev/null +++ b/go.sum @@ -0,0 +1,13 @@ +github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409 h1:DTQ/38ao/CfXsrK0cSAL+h4R/u0VVvfWLZEOlLwEROI= +github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ= +github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/object.go b/object.go index 6932a93..8e6c4af 100644 --- a/object.go +++ b/object.go @@ -133,6 +133,8 @@ type ObjectPutHeaderOptions struct { XCosStorageClass string `header:"x-cos-storage-class,omitempty" url:"-"` // 可选值: Normal, Appendable //XCosObjectType string `header:"x-cos-object-type,omitempty" url:"-"` + // Enable Server Side Encryption, Only supported: AES256 + XCosServerSideEncryption string `header:"x-cos-server-side-encryption,omitempty" url:"-" xml:"-"` } // ObjectPutOptions the options of put object diff --git a/object_part_test.go b/object_part_test.go index 662d4ed..16b7ed2 100644 --- a/object_part_test.go +++ b/object_part_test.go @@ -168,7 +168,7 @@ func TestObjectService_ListParts(t *testing.T) { }) ref, _, err := client.Object.ListParts(context.Background(), - name, uploadID) + name, uploadID, nil) if err != nil { t.Fatalf("Object.ListParts returned error: %v", err) } @@ -182,7 +182,7 @@ func TestObjectService_ListParts(t *testing.T) { ID: "1253846586", DisplayName: "1253846586", }, - PartNumberMarker: 0, + PartNumberMarker: "0", Initiator: &Initiator{ ID: "qcs::cam::uin/100000760461:uin/100000760461", DisplayName: "100000760461", @@ -202,7 +202,7 @@ func TestObjectService_ListParts(t *testing.T) { }, }, StorageClass: "Standard", - MaxParts: 1000, + MaxParts: "1000", IsTruncated: false, }