| 123456789101112131415161718192021222324252627 |
- package configs
- //配置文件序列化对象
- type Config struct {
- Mysql Mysql `mapstructure:"mysql"`
- Redis Redis
- }
- type Mysql struct {
- Host string `mapstructure:"host"`
- Port int `mapstructure:"port"`
- Username string `mapstructure:"username"`
- Password string `mapstructure:"password"`
- Database string `mapstructure:"database"`
- Charset string `mapstructure:"charset"`
- }
- type Redis struct {
- Host string
- Password string
- Db int64
- }
- func NewConfig() *Config {
- return &Config{}
- }
|