1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| package upload
|
| import (
| "mime/multipart"
|
| "srm/global"
| )
|
| // OSS 对象存储接口
| // Author [SliverHorn](https://github.com/SliverHorn)
| // Author [ccfish86](https://github.com/ccfish86)
| type OSS interface {
| UploadFile(file *multipart.FileHeader) (string, string, error)
| DeleteFile(key string) error
| }
|
| // NewOss OSS的实例化方法
| // Author [SliverHorn](https://github.com/SliverHorn)
| // Author [ccfish86](https://github.com/ccfish86)
| func NewOss() OSS {
| switch global.GVA_CONFIG.System.OssType {
| case "local":
| return &Local{}
| case "qiniu":
| return &Qiniu{}
| case "tencent-cos":
| return &TencentCOS{}
| case "aliyun-oss":
| return &AliyunOSS{}
| case "huawei-obs":
| return HuaWeiObs
| case "aws-s3":
| return &AwsS3{}
| default:
| return &Local{}
| }
| }
|
|