Skip to content

Commit 65ce6c7

Browse files
committed
add oss gateway
1 parent 1e37dd0 commit 65ce6c7

File tree

8 files changed

+1376
-1
lines changed

8 files changed

+1376
-1
lines changed

cmd/api-errors.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"strings"
2626

2727
"github.com/Azure/azure-storage-blob-go/azblob"
28+
"github.com/aliyun/aliyun-oss-go-sdk/oss"
2829
"google.golang.org/api/googleapi"
2930

3031
minio "github.com/minio/minio-go/v6"
@@ -1968,6 +1969,12 @@ func toAPIError(ctx context.Context, err error) APIError {
19681969
Description: e.Error(),
19691970
HTTPStatusCode: e.Response().StatusCode,
19701971
}
1972+
case oss.ServiceError:
1973+
apiErr = APIError{
1974+
Code: e.Code,
1975+
Description: e.Message,
1976+
HTTPStatusCode: e.StatusCode,
1977+
}
19711978
// Add more Gateway SDKs here if any in future.
19721979
}
19731980
}

cmd/gateway/gateway.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ import (
2525
// Azure
2626
_ "github.com/minio/minio/cmd/gateway/azure"
2727

28+
// OSS
29+
_ "github.com/minio/minio/cmd/gateway/oss"
30+
2831
// S3
2932
_ "github.com/minio/minio/cmd/gateway/s3"
3033

0 commit comments

Comments
 (0)