add stats daily
This commit is contained in:
14
config.go
14
config.go
@@ -44,18 +44,20 @@ type ClientConfig struct {
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Server *ServerConfig `json:"server"`
|
||||
Telegram *TelegramConfig `json:"telegram"`
|
||||
Game *GameConfig `json:"game"`
|
||||
Clients map[int]*ClientConfig `json:"clients"`
|
||||
Stats map[int]map[string]*Stat `json:"stats"`
|
||||
Server *ServerConfig `json:"server"`
|
||||
Telegram *TelegramConfig `json:"telegram"`
|
||||
Game *GameConfig `json:"game"`
|
||||
Clients map[int]*ClientConfig `json:"clients"`
|
||||
StatsMonthly map[int]map[string]*StatMonthly `json:"stats_monthly"`
|
||||
StatsDaily map[int]map[string]*StatDaily `json:"stats_daily"`
|
||||
}
|
||||
|
||||
// Init values for a config based on package defaults
|
||||
func (c *Config) Init() error {
|
||||
err := json.Unmarshal(cfgSample, &c)
|
||||
c.Clients = make(map[int]*ClientConfig)
|
||||
c.Stats = make(map[int]map[string]*Stat)
|
||||
c.StatsMonthly = make(map[int]map[string]*StatMonthly)
|
||||
c.StatsDaily = make(map[int]map[string]*StatDaily)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user