Add files via upload

pull/361/head
overBaker 2 years ago committed by GitHub
parent b74ffde782
commit 2384b02f95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -21,9 +21,6 @@ import (
"github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/core"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/tencentyun/cos-go-sdk-v5" "github.com/tencentyun/cos-go-sdk-v5"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
) )
func MustAliossService() (core.ObjectStorageService, core.VersionInfo) { func MustAliossService() (core.ObjectStorageService, core.VersionInfo) {
@ -232,12 +229,15 @@ func MustMinioService() (core.ObjectStorageService, core.VersionInfo) {
} }
func MustS3Service() (core.ObjectStorageService, core.VersionInfo) { func MustS3Service() (core.ObjectStorageService, core.VersionInfo) {
// Initialize AWS S3 client object. // Initialize s3 client object use minio-go.
client, err := s3.NewClient(conf.S3Setting.Region, conf.S3Setting.AccessKey, conf.S3Setting.SecretKey) client, err := minio.New(conf.S3Setting.Endpoint, &minio.Options{
Creds: credentials.NewStaticV4(conf.S3Setting.AccessKey, conf.S3Setting.SecretKey, ""),
Secure: conf.S3Setting.Secure,
})
if err != nil { if err != nil {
logrus.Fatalf("storage.MustS3Service create client failed: %s", err) logrus.Fatalf("storage.MustS3Service create client failed: %s", err)
} }
domain := conf.GetOssDomain() domain := conf.GetOssDomain()
var cs core.OssCreateService var cs core.OssCreateService
if cfg.If("OSS:TempDir") { if cfg.If("OSS:TempDir") {
@ -265,7 +265,7 @@ func MustS3Service() (core.ObjectStorageService, core.VersionInfo) {
} }
logrus.Debugln("use OSS:Direct feature") logrus.Debugln("use OSS:Direct feature")
} }
obj := &s3Servant{ obj := &s3Servant{
OssCreateService: cs, OssCreateService: cs,
client: client, client: client,

Loading…
Cancel
Save