| 12345678910111213141516171819202122232425262728293031 |
- package config
- // ServerConfig 服务器配置
- type ServerConfig struct {
- Port int `yaml:"port"`
- }
- // MySQLConfig MySQL数据库配置
- type MySQLConfig struct {
- Host string `yaml:"host"`
- Port int `yaml:"port"`
- Username string `yaml:"username"`
- Password string `yaml:"password"`
- Dbname string `yaml:"dbname"`
- Charset string `yaml:"charset"`
- ParseTime bool `yaml:"parseTime"`
- Loc string `yaml:"loc"`
- }
- // JWTConfig JWT配置
- type JWTConfig struct {
- Secret string `yaml:"secret"`
- Expire int `yaml:"expire"`
- }
- // Config 配置结构体
- type Config struct {
- Server ServerConfig `yaml:"server"`
- MySQL MySQLConfig `yaml:"mysql"`
- JWT JWTConfig `yaml:"jwt"`
- }
|