25 lines
445 B
Go
25 lines
445 B
Go
package global
|
|
|
|
import (
|
|
"time"
|
|
"yintai-api/base/global/storage"
|
|
)
|
|
|
|
var (
|
|
qiniuStorage storage.Storage
|
|
)
|
|
|
|
func InitStorage() error {
|
|
qiniuStorage = storage.NewQiniu(&storage.QiniuConfig{
|
|
Bucket: GetConfig().Storage.QiniuBucket,
|
|
AK: GetConfig().Storage.QiniuAccessKey,
|
|
SK: GetConfig().Storage.QiniuSecretKey,
|
|
Timeout: time.Second * 60,
|
|
})
|
|
return nil
|
|
}
|
|
|
|
func GetStorage(...string) storage.Storage {
|
|
return qiniuStorage
|
|
}
|