34 lines
874 B
Go
34 lines
874 B
Go
package config
|
|
|
|
type ServerConfig struct {
|
|
Listen string `yaml:"listen"`
|
|
Port int `yaml:"port"`
|
|
Name string `yaml:"name"`
|
|
Env string `yaml:"env"`
|
|
UrlPrefix string `yaml:"urlPrefix"`
|
|
LogPath string `yaml:"logPath"`
|
|
MySQL MySQLConfig `yaml:"mysql"`
|
|
Redis RedisConfig `yaml:"redis"`
|
|
Jwt JwtConfig `yaml:"jwt"`
|
|
}
|
|
|
|
type MySQLConfig struct {
|
|
Host string `yaml:"host"`
|
|
Port int `yaml:"port"`
|
|
Username string `yaml:"username"`
|
|
Password string `yaml:"password"`
|
|
Database string `yaml:"database"`
|
|
}
|
|
|
|
type RedisConfig struct {
|
|
Host string `yaml:"host"`
|
|
Port int `yaml:"port"`
|
|
Password string `yaml:"password"`
|
|
}
|
|
|
|
type JwtConfig struct {
|
|
Secret string `yaml:"secret"`
|
|
RenewExpireDays uint `yaml:"renewExpireDays"`
|
|
RenewAheadDays uint `yaml:"renewAheadDays"`
|
|
}
|