fordecember f34f507652
update: 七牛云对象存储逻辑
- 单文件上传
- 多文件并行上传
- 文件删除
- 单元测试
2024-11-10 15:02:06 +08:00

22 lines
564 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package oss
import "catface/app/global/variable"
const qiNiuBucket = "sakura-fox-asia"
const qiNiuDomain = "https://images.cengkehepler.top"
// 12. 初始化全局变量
var (
qiNiuAccessKey string
qiNiuSecretKey string
)
func init() {
// 如果没有配置七牛云的key和secret那么直接panic
qiNiuAccessKey = variable.ConfigYml.GetString("QiNiu.AccessKey")
qiNiuSecretKey = variable.ConfigYml.GetString("QiNiu.SecretKey")
if qiNiuAccessKey == "" || qiNiuSecretKey == "" {
panic("七牛云配置文件中 AccessKey 或 SecretKey 为空")
}
}