oss.go 2.0 KB

1234567891011121314151617181920212223242526272829303132
  1. package config
  2. type Local struct {
  3. Path string `mapstructure:"path" json:"path" yaml:"path"` // 本地文件路径
  4. }
  5. type Qiniu struct {
  6. Zone string `mapstructure:"zone" json:"zone" yaml:"zone"` // 存储区域
  7. Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"` // 空间名称
  8. ImgPath string `mapstructure:"img-path" json:"imgPath" yaml:"img-path"` // CDN加速域名
  9. UseHTTPS bool `mapstructure:"use-https" json:"useHttps" yaml:"use-https"` // 是否使用https
  10. AccessKey string `mapstructure:"access-key" json:"accessKey" yaml:"access-key"` // 秘钥AK
  11. SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"` // 秘钥SK
  12. UseCdnDomains bool `mapstructure:"use-cdn-domains" json:"useCdnDomains" yaml:"use-cdn-domains"` // 上传是否使用CDN上传加速
  13. }
  14. type AliyunOSS struct {
  15. Endpoint string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"`
  16. AccessKeyId string `mapstructure:"access-key-id" json:"accessKeyId" yaml:"access-key-id"`
  17. AccessKeySecret string `mapstructure:"access-key-secret" json:"accessKeySecret" yaml:"access-key-secret"`
  18. BucketName string `mapstructure:"bucket-name" json:"bucketName" yaml:"bucket-name"`
  19. BucketUrl string `mapstructure:"bucket-url" json:"bucketUrl" yaml:"bucket-url"`
  20. BasePath string `mapstructure:"base-path" json:"basePath" yaml:"base-path"`
  21. }
  22. type TencentCOS struct {
  23. Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
  24. Region string `mapstructure:"region" json:"region" yaml:"region"`
  25. SecretID string `mapstructure:"secret-id" json:"secretID" yaml:"secret-id"`
  26. SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`
  27. BaseURL string `mapstructure:"base-url" json:"baseURL" yaml:"base-url"`
  28. PathPrefix string `mapstructure:"path-prefix" json:"pathPrefix" yaml:"path-prefix"`
  29. }