-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfig.go
72 lines (52 loc) · 2.72 KB
/
config.go
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* @Time: 2022/2/22 02:03
* @Author: yt.yin
*/
package goconfig
import (
"github.com/goworkeryyt/go-config/captcha"
"github.com/goworkeryyt/go-config/consul"
"github.com/goworkeryyt/go-config/database"
"github.com/goworkeryyt/go-config/email"
"github.com/goworkeryyt/go-config/ftp"
"github.com/goworkeryyt/go-config/jwt"
"github.com/goworkeryyt/go-config/mqtt"
"github.com/goworkeryyt/go-config/pay"
"github.com/goworkeryyt/go-config/redis"
"github.com/goworkeryyt/go-config/server"
"github.com/goworkeryyt/go-config/zap"
"github.com/spf13/viper"
)
// Config 项目单节点统一配置
type Config struct {
/** 服务实例配置 */
Server server.Server `mapstructure:"server" json:"server" yaml:"server"`
/** 注册中心配置 */
Consul consul.Consul `mapstructure:"consul" json:"consul" yaml:"consul"`
/** 验证码配置 */
Captcha captcha.Captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"`
/** MySQL 数据库配置 */
MySQL database.MySQL `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
/** Postgre 数据库配置 */
PostgreSQL database.PostgreSQL `mapstructure:"postgre" json:"postgre" yaml:"postgre"`
/** sqlite 数据库配置 */
SQLite database.SQLite `mapstructure:"sqlite" json:"sqlite" yaml:"sqlite"`
/** redis 缓存数据库配置 */
Redis redis.Redis `mapstructure:"redis" json:"redis" yaml:"redis"`
/** 邮件发送相关配置 */
Email email.Email `mapstructure:"email" json:"email" yaml:"email"`
/** 文件服务器配置 */
Ftp ftp.Ftp `mapstructure:"ftp" json:"local" yaml:"ftp"`
/** jwt token 相关配置 */
JWT jwt.JWT `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
/** mqtt 代理服务器相关配置 */
Mqtt mqtt.Mqtt `mapstructure:"mqtt" json:"mqtt" yaml:"mqtt"`
/** 日志相关配置 */
Zap zap.Zap `mapstructure:"zap" json:"zap" yaml:"zap"`
/** 支付相关配置-支付宝 */
AliPay pay.Alipay `mapstructure:"alipay" json:"alipay" yaml:"alipay"`
/** 支付相关配置-微信 */
Weichat pay.Weichat `mapstructure:"weichat" json:"weichat" yaml:"weichat"`
/** 可自己取一些扩展配置 */
Viper *viper.Viper
}