2021-01-19 12:05:43 +08:00
|
|
|
|
package systemconfigs
|
|
|
|
|
|
|
2022-01-03 21:51:24 +08:00
|
|
|
|
// DatabaseConfig 数据库相关配置
|
2021-01-19 12:05:43 +08:00
|
|
|
|
type DatabaseConfig struct {
|
|
|
|
|
|
ServerAccessLog struct {
|
|
|
|
|
|
Clean struct {
|
|
|
|
|
|
Days int `json:"days"` // 日志保留天数,0表示不限制
|
|
|
|
|
|
} `json:"clean"` // 清理相关配置
|
|
|
|
|
|
} `json:"serverAccessLog"` // 服务访问日志相关配置
|
2023-07-01 17:55:10 +08:00
|
|
|
|
|
|
|
|
|
|
HTTPCacheTask struct {
|
|
|
|
|
|
Clean struct {
|
|
|
|
|
|
Days int `json:"days"`
|
|
|
|
|
|
} `json:"clean"`
|
|
|
|
|
|
} `json:"httpCacheTask"` // 缓存任务
|
|
|
|
|
|
|
|
|
|
|
|
NodeTrafficDailyStat struct {
|
|
|
|
|
|
Clean struct {
|
|
|
|
|
|
Days int `json:"days"`
|
|
|
|
|
|
} `json:"clean"`
|
|
|
|
|
|
} `json:"nodeTrafficDailyStat"`
|
|
|
|
|
|
|
|
|
|
|
|
ServerBandwidthStat struct {
|
|
|
|
|
|
Clean struct {
|
|
|
|
|
|
Days int `json:"days"`
|
|
|
|
|
|
} `json:"clean"`
|
|
|
|
|
|
} `json:"serverBandwidthStat"`
|
|
|
|
|
|
|
|
|
|
|
|
ServerDailyStat struct {
|
|
|
|
|
|
Clean struct {
|
|
|
|
|
|
Days int `json:"days"`
|
|
|
|
|
|
} `json:"clean"`
|
|
|
|
|
|
} `json:"serverDailyStat"`
|
|
|
|
|
|
|
|
|
|
|
|
UserBandwidthStat struct {
|
|
|
|
|
|
Clean struct {
|
|
|
|
|
|
Days int `json:"days"`
|
|
|
|
|
|
} `json:"clean"`
|
|
|
|
|
|
} `json:"userBandwidthStat"`
|
|
|
|
|
|
|
2023-09-06 16:31:14 +08:00
|
|
|
|
UserPlanBandwidthStat struct {
|
|
|
|
|
|
Clean struct {
|
|
|
|
|
|
Days int `json:"days"`
|
|
|
|
|
|
} `json:"clean"`
|
|
|
|
|
|
} `json:"userPlanBandwidthStat"`
|
|
|
|
|
|
|
2023-07-01 17:55:10 +08:00
|
|
|
|
NodeClusterTrafficDailyStat struct {
|
|
|
|
|
|
Clean struct {
|
|
|
|
|
|
Days int `json:"days"`
|
|
|
|
|
|
} `json:"clean"`
|
|
|
|
|
|
} `json:"nodeClusterTrafficDailyStat"`
|
|
|
|
|
|
|
|
|
|
|
|
NodeTrafficHourlyStat struct {
|
|
|
|
|
|
Clean struct {
|
|
|
|
|
|
Days int `json:"days"`
|
|
|
|
|
|
} `json:"clean"`
|
|
|
|
|
|
} `json:"nodeTrafficHourlyStat"`
|
|
|
|
|
|
|
|
|
|
|
|
ServerDomainHourlyStat struct {
|
|
|
|
|
|
Clean struct {
|
|
|
|
|
|
Days int `json:"days"`
|
|
|
|
|
|
} `json:"clean"`
|
|
|
|
|
|
} `json:"serverDomainHourlyStat"`
|
|
|
|
|
|
|
|
|
|
|
|
TrafficDailyStat struct {
|
|
|
|
|
|
Clean struct {
|
|
|
|
|
|
Days int `json:"days"`
|
|
|
|
|
|
} `json:"clean"`
|
|
|
|
|
|
} `json:"trafficDailyStat"`
|
|
|
|
|
|
|
|
|
|
|
|
TrafficHourlyStat struct {
|
|
|
|
|
|
Clean struct {
|
|
|
|
|
|
Days int `json:"days"`
|
|
|
|
|
|
} `json:"clean"`
|
|
|
|
|
|
} `json:"trafficHourlyStat"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func NewDatabaseConfig() *DatabaseConfig {
|
|
|
|
|
|
var config = &DatabaseConfig{}
|
|
|
|
|
|
config.ServerAccessLog.Clean.Days = 14
|
|
|
|
|
|
config.HTTPCacheTask.Clean.Days = 30
|
|
|
|
|
|
config.NodeTrafficDailyStat.Clean.Days = 32
|
|
|
|
|
|
config.ServerBandwidthStat.Clean.Days = 100
|
|
|
|
|
|
config.ServerDailyStat.Clean.Days = 60
|
|
|
|
|
|
config.UserBandwidthStat.Clean.Days = 100
|
2023-09-06 16:31:14 +08:00
|
|
|
|
config.UserPlanBandwidthStat.Clean.Days = 100
|
2023-07-01 17:55:10 +08:00
|
|
|
|
config.NodeClusterTrafficDailyStat.Clean.Days = 30
|
|
|
|
|
|
config.NodeTrafficHourlyStat.Clean.Days = 15
|
|
|
|
|
|
config.ServerDomainHourlyStat.Clean.Days = 7
|
|
|
|
|
|
config.TrafficDailyStat.Clean.Days = 30
|
|
|
|
|
|
config.TrafficHourlyStat.Clean.Days = 15
|
|
|
|
|
|
return config
|
2021-01-19 12:05:43 +08:00
|
|
|
|
}
|