feat: support Casdoor storage provider (#3147)

* feat: support Casdoor storage provider

* fix: fix code format and nil pointer error

* feat: change cert if statement
This commit is contained in:
DacongDA
2024-08-27 23:54:03 +08:00
committed by GitHub
parent 62bb257c6d
commit c08f2b1f3f
8 changed files with 87 additions and 16 deletions

19
storage/casdoor.go Normal file
View File

@ -0,0 +1,19 @@
package storage
import (
"github.com/casdoor/oss"
"github.com/casdoor/oss/casdoor"
)
func NewCasdoorStorageProvider(providerType string, clientId string, clientSecret string, region string, bucket string, endpoint string, cert string, content string) oss.StorageInterface {
sp := casdoor.New(&casdoor.Config{
clientId,
clientSecret,
endpoint,
cert,
region,
content,
bucket,
})
return sp
}