feat: fix Google cloud storage provider bug

This commit is contained in:
Yang Luo
2023-12-14 00:06:38 +08:00
parent dc06eb9948
commit 08864686f3
7 changed files with 272 additions and 49 deletions

View File

@ -19,13 +19,15 @@ import (
"github.com/casdoor/oss/googlecloud"
)
func NewGoogleCloudStorageProvider(clientId string, clientSecret string, bucket string, endpoint string) oss.StorageInterface {
sp, _ := googlecloud.New(&googlecloud.Config{
AccessID: clientId,
AccessKey: clientSecret,
Bucket: bucket,
Endpoint: endpoint,
func NewGoogleCloudStorageProvider(clientSecret string, bucket string, endpoint string) oss.StorageInterface {
sp, err := googlecloud.New(&googlecloud.Config{
ServiceAccountJson: clientSecret,
Bucket: bucket,
Endpoint: endpoint,
})
if err != nil {
panic(err)
}
return sp
}