Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Implement GSP-73 Organization rename #24

Merged
merged 1 commit into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
- *: Add UnimplementedStub (#12)
- tests: Introduce STORAGE_OSS_INTEGRATION_TEST (#13)
- storage: Implement SSE support (#14)
- storage: Implement AOS-40 (#16)
- storage: Implement GSP-40 (#16)

### Changed

Expand All @@ -30,4 +30,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

- Implement oss services.

[v1.1.0]: https://github.com/aos-dev/go-service-oss/compare/v1.0.0...v1.1.0
[v1.1.0]: https://github.com/beyondstorage/go-service-oss/compare/v1.0.0...v1.1.0
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# go-services-oss

[![Build Status](https://github.com/aos-dev/go-service-oss/workflows/Unit%20Test/badge.svg?branch=master)](https://github.com/aos-dev/go-service-oss/actions?query=workflow%3A%22Unit+Test%22)
[![Build Status](https://github.com/beyondstorage/go-service-oss/workflows/Unit%20Test/badge.svg?branch=master)](https://github.com/beyondstorage/go-service-oss/actions?query=workflow%3A%22Unit+Test%22)
[![License](https://img.shields.io/badge/license-apache%20v2-blue.svg)](https://github.com/Xuanwo/storage/blob/master/LICENSE)
[![go storage dev](https://img.shields.io/matrix/go-service-oss:aos.dev.svg?server_fqdn=chat.aos.dev&label=%23go-service-oss%3Aaos.dev&logo=matrix)](https://matrix.to/#/#go-service-oss:aos.dev)

oss services support for [go-storage](https://github.com/aos-dev/go-storage)
oss services support for [go-storage](https://github.com/beyondstorage/go-storage)

## Install

```go
go get github.com/aos-dev/go-service-oss
go get github.com/beyondstorage/go-service-oss/v2
```
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Package oss provided support for Aliyun Object Storage Service (https://cn.aliyu
*/
package oss

//go:generate go run -tags tools github.com/aos-dev/go-storage/v3/cmd/definitions service.toml
//go:generate go run -tags tools github.com/beyondstorage/go-storage/v4/cmd/definitions service.toml
30 changes: 9 additions & 21 deletions generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/aos-dev/go-service-oss
module github.com/beyondstorage/go-service-oss/v2

go 1.14

require (
github.com/aliyun/aliyun-oss-go-sdk v2.1.8+incompatible
github.com/aos-dev/go-integration-test/v3 v3.0.1-0.20210512065058-b6c8caf13bc6
github.com/aos-dev/go-storage/v3 v3.6.1-0.20210513125055-cb9106d884d5
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
github.com/beyondstorage/go-integration-test/v4 v4.0.0-20210521062555-83f8f166943f
github.com/beyondstorage/go-storage/v4 v4.0.0-20210521045436-248353dfc077
github.com/google/uuid v1.2.0
github.com/satori/go.uuid v1.2.0 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
Expand Down
15 changes: 6 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ github.com/Xuanwo/templateutils v0.1.0 h1:WpkWOqQtIQ2vAIpJLa727DdN8WtxhUkkbDGa6U
github.com/Xuanwo/templateutils v0.1.0/go.mod h1:OdE0DJ+CJxDBq6psX5DPV+gOZi8bhuHuVUpPCG++Wb8=
github.com/aliyun/aliyun-oss-go-sdk v2.1.8+incompatible h1:hLUNPbx10wawWW7DeNExvTrlb90db3UnnNTFKHZEFhE=
github.com/aliyun/aliyun-oss-go-sdk v2.1.8+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
github.com/aos-dev/go-integration-test/v3 v3.0.1-0.20210512065058-b6c8caf13bc6 h1:73QZDkTGFyWpkWVrjs0GEM1VREyEmM7RtzddWtBYXho=
github.com/aos-dev/go-integration-test/v3 v3.0.1-0.20210512065058-b6c8caf13bc6/go.mod h1:iMlF4lL4WavgZezGscajjSNcUdFnacX8Dek6lhE0oJA=
github.com/aos-dev/go-storage/v3 v3.6.1-0.20210512033924-5adf27cfdf96/go.mod h1:6arAU5t7CXEsxDPs87xqgHmvEj8/GQfHlV61CxxC0Ww=
github.com/aos-dev/go-storage/v3 v3.6.1-0.20210513125055-cb9106d884d5 h1:xiJN6PvJPDDVac4Ha+ekuGUjRh49O1a1xwxrJPCwlto=
github.com/aos-dev/go-storage/v3 v3.6.1-0.20210513125055-cb9106d884d5/go.mod h1:qareAWtwrRlx4Fw6XIhtAbQnM7I3wylhaQ5Gr3Q5Geg=
github.com/aos-dev/specs/go v0.0.0-20210512024100-386a13f23a83/go.mod h1:gNah3KaPJEfysh7uCCX+sYjQC3g2yx2VgBkFlT945Ws=
github.com/aos-dev/specs/go v0.0.0-20210512093613-3e7634b4a7f5 h1:MmXROEim7Z9u1lFLRvZCy/yKBhq3k1Q/nvaVQmVvZUU=
github.com/aos-dev/specs/go v0.0.0-20210512093613-3e7634b4a7f5/go.mod h1:owye99eWsZvtg5kCEKtSp+AsRPsANhnXgCzHacu4icM=
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA=
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
github.com/beyondstorage/go-integration-test/v4 v4.0.0-20210521062555-83f8f166943f h1:2a44nxIWm5DgEb6/gnD3We/32Bx19ET0iOM4+mxOmp8=
github.com/beyondstorage/go-integration-test/v4 v4.0.0-20210521062555-83f8f166943f/go.mod h1:PUhp+CDYnsysCKVU7poqIK7ZWTfADkOu2Z/PjlSIhsY=
github.com/beyondstorage/go-storage/v4 v4.0.0-20210521045436-248353dfc077 h1:BxqrLLELv6ZvP4+DZlwPAwBhNYkQqpZFvujvUT8zGiY=
github.com/beyondstorage/go-storage/v4 v4.0.0-20210521045436-248353dfc077/go.mod h1:oa2dYco+xplPj99WSBnYVw/xXvRkIKWSSVDQKNZ5Kz8=
github.com/beyondstorage/specs/go v0.0.0-20210521044836-3d41c1d9c97f h1:KMXKB/LACUmnOfLfjND8222qtzWT9lWRUdsPOlM4FqE=
github.com/beyondstorage/specs/go v0.0.0-20210521044836-3d41c1d9c97f/go.mod h1:f5VvmLHc/dNJwl+/yAv/TOHdev3phvuEswx8DIXiSQQ=
github.com/dave/dst v0.26.2 h1:lnxLAKI3tx7MgLNVDirFCsDTlTG9nKTk7GcptKcWSwY=
github.com/dave/dst v0.26.2/go.mod h1:UMDJuIRPfyUCC78eFuB+SV/WI8oDeyFDvM/JR6NI3IU=
github.com/dave/gopackages v0.0.0-20170318123100-46e7023ec56e/go.mod h1:i00+b/gKdIDIxuLDFob7ustLAVqhsZRk2qVZrArELGQ=
Expand All @@ -37,7 +35,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/pelletier/go-toml v1.9.0/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pelletier/go-toml v1.9.1 h1:a6qW1EVNZWH9WGI6CsYdD8WAylkoXBS5yv0XHlh17Tc=
github.com/pelletier/go-toml v1.9.1/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
2 changes: 1 addition & 1 deletion iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ type partPageStatus struct {
}

func (i *partPageStatus) ContinuationToken() string {
return strconv.FormatInt(int64(i.partNumberMarker), 10)
return strconv.FormatInt(i.partNumberMarker, 10)
}
4 changes: 2 additions & 2 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"github.com/aliyun/aliyun-oss-go-sdk/oss"

ps "github.com/aos-dev/go-storage/v3/pairs"
typ "github.com/aos-dev/go-storage/v3/types"
ps "github.com/beyondstorage/go-storage/v4/pairs"
typ "github.com/beyondstorage/go-storage/v4/types"
)

func (s *Service) create(ctx context.Context, name string, opt pairServiceCreate) (store typ.Storager, err error) {
Expand Down
14 changes: 7 additions & 7 deletions storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (

"github.com/aliyun/aliyun-oss-go-sdk/oss"

"github.com/aos-dev/go-storage/v3/pkg/headers"
"github.com/aos-dev/go-storage/v3/pkg/iowrap"
"github.com/aos-dev/go-storage/v3/services"
. "github.com/aos-dev/go-storage/v3/types"
"github.com/beyondstorage/go-storage/v4/pkg/headers"
"github.com/beyondstorage/go-storage/v4/pkg/iowrap"
"github.com/beyondstorage/go-storage/v4/services"
. "github.com/beyondstorage/go-storage/v4/types"
)

func (s *Storage) commitAppend(ctx context.Context, o *Object, opt pairStorageCommitAppend) (err error) {
Expand Down Expand Up @@ -143,7 +143,7 @@ func (s *Storage) delete(ctx context.Context, path string, opt pairStorageDelete
})
if err != nil && checkError(err, responseCodeNoSuchUpload) {
// Omit `NoSuchUpdate` error here
// ref: [AOS-46](https://github.com/aos-dev/specs/blob/master/rfcs/46-idempotent-delete.md)
// ref: [GSP-46](https://github.com/beyondstorage/specs/blob/master/rfcs/46-idempotent-delete.md)
err = nil
}
if err != nil {
Expand All @@ -155,7 +155,7 @@ func (s *Storage) delete(ctx context.Context, path string, opt pairStorageDelete
// OSS DeleteObject is idempotent, so we don't need to check NoSuchKey error.
//
// References
// - [AOS-46](https://github.com/aos-dev/specs/blob/master/rfcs/46-idempotent-delete.md)
// - [GSP-46](https://github.com/beyondstorage/specs/blob/master/rfcs/46-idempotent-delete.md)
// - https://help.aliyun.com/document_detail/31982.html
err = s.bucket.DeleteObject(rp)
if err != nil {
Expand Down Expand Up @@ -197,7 +197,7 @@ func (s *Storage) listMultipart(ctx context.Context, o *Object, opt pairStorageL
return NewPartIterator(ctx, s.nextPartPage, input), nil
}

func (s *Storage) metadata(ctx context.Context, opt pairStorageMetadata) (meta *StorageMeta, err error) {
func (s *Storage) metadata(opt pairStorageMetadata) (meta *StorageMeta) {
meta = NewStorageMeta()
meta.Name = s.bucket.BucketName
meta.WorkDir = s.workDir
Expand Down
2 changes: 1 addition & 1 deletion tests/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"testing"

tests "github.com/aos-dev/go-integration-test/v3"
tests "github.com/beyondstorage/go-integration-test/v4"
)

func TestStorage(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions tests/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"os"
"testing"

oss "github.com/aos-dev/go-service-oss"
ps "github.com/aos-dev/go-storage/v3/pairs"
"github.com/aos-dev/go-storage/v3/types"
oss "github.com/beyondstorage/go-service-oss/v2"
ps "github.com/beyondstorage/go-storage/v4/pairs"
"github.com/beyondstorage/go-storage/v4/types"
"github.com/google/uuid"
)

Expand Down
2 changes: 1 addition & 1 deletion tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package oss

import _ "github.com/aos-dev/go-storage/v3/cmd/definitions"
import _ "github.com/beyondstorage/go-storage/v4/cmd/definitions"
14 changes: 7 additions & 7 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (

"github.com/aliyun/aliyun-oss-go-sdk/oss"

ps "github.com/aos-dev/go-storage/v3/pairs"
"github.com/aos-dev/go-storage/v3/pkg/credential"
"github.com/aos-dev/go-storage/v3/pkg/endpoint"
"github.com/aos-dev/go-storage/v3/pkg/httpclient"
"github.com/aos-dev/go-storage/v3/services"
typ "github.com/aos-dev/go-storage/v3/types"
ps "github.com/beyondstorage/go-storage/v4/pairs"
"github.com/beyondstorage/go-storage/v4/pkg/credential"
"github.com/beyondstorage/go-storage/v4/pkg/endpoint"
"github.com/beyondstorage/go-storage/v4/pkg/httpclient"
"github.com/beyondstorage/go-storage/v4/services"
typ "github.com/beyondstorage/go-storage/v4/types"
)

// Service is the aliyun oss *Service config.
Expand Down Expand Up @@ -136,7 +136,7 @@ const (
)

func formatError(err error) error {
if _, ok := err.(services.AosError); ok {
if _, ok := err.(services.InternalError); ok {
return err
}

Expand Down