woj-server/internal/model/config.go

51 lines
1.4 KiB
Go
Raw Normal View History

2023-07-15 16:19:49 +08:00
package model
2022-09-07 23:34:37 +08:00
type ConfigWebServer struct {
2022-09-17 10:10:53 +08:00
Address string `yaml:"Address"`
Port int `yaml:"Port"`
JwtSigningKey string `yaml:"JwtSigningKey"`
JwtExpireHour int `yaml:"JwtExpireHour"`
2022-09-07 23:34:37 +08:00
}
type ConfigRedis struct {
Db int `yaml:"Db"`
2022-10-13 16:32:44 +08:00
QueueDb int `yaml:"QueueDb"`
2022-09-07 23:34:37 +08:00
Address string `yaml:"Address"`
Port int `yaml:"Port"`
2022-09-07 23:34:37 +08:00
Password string `yaml:"Password"`
}
2022-09-08 22:00:25 +08:00
type ConfigDatabase struct {
Host string `yaml:"Host"`
Port int `yaml:"Port"`
User string `yaml:"User"`
Password string `yaml:"Password"`
Database string `yaml:"Database"`
Prefix string `yaml:"Prefix"`
MaxOpenConns int `yaml:"MaxOpenConns"`
MaxIdleConns int `yaml:"MaxIdleConns"`
ConnMaxLifetime int `yaml:"ConnMaxLifetime"`
}
type ConfigStorage struct {
Endpoint string `yaml:"Endpoint"`
UseSSL bool `yaml:"UseSSL"`
AccessKey string `yaml:"AccessKey"`
SecretKey string `yaml:"SecretKey"`
Bucket string `yaml:"Bucket"`
}
2022-09-07 23:34:37 +08:00
type ConfigMetrics struct {
Namespace string `yaml:"Namespace"`
Subsystem string `yaml:"Subsystem"`
}
type Config struct {
WebServer ConfigWebServer `yaml:"WebServer"`
Redis ConfigRedis `yaml:"Redis"`
2022-09-08 22:00:25 +08:00
Database ConfigDatabase `yaml:"Database"`
Storage ConfigStorage `yaml:"Storage"`
2022-09-07 23:34:37 +08:00
Metrics ConfigMetrics `yaml:"Metrics"`
Development bool `yaml:"Development"`
}