@@ -15,11 +15,10 @@ import (
1515)
1616
1717type Dev struct {
18- Password string `mapstructure:"password"`
19- Key string `mapstructure:"key"`
20- IP string `mapstructure:"ip"`
21- RouterUnit bool `mapstructure:"routerunit"`
22- IsLocal bool `mapstructure:"islocal"`
18+ Password string `mapstructure:"password"`
19+ Key string `mapstructure:"key"`
20+ IP string `mapstructure:"ip"`
21+ IsLocal bool `mapstructure:"islocal"`
2322}
2423
2524type History struct {
@@ -29,18 +28,17 @@ type History struct {
2928}
3029
3130type AppConfig struct {
32- Dev []Dev `mapstructure:"dev"`
33- History History `mapstructure:"history"`
34- Debug bool `mapstructure:"debug"`
35- Port int `mapstructure:"port"`
36- Address string `mapstructure:"address"`
37- Tiny bool `mapstructure:"tiny"`
38- FlushTokenTime int `mapstructure:"flushTokenTime"`
39- Netdata_routernum int `mapstructure:"netdata_routernum"`
40- Workdirectory string `mapstructure:"-"`
41- Databasepath string `mapstructure:"-"`
42- ApiKey string `mapstructure:"api_key"`
43- SafeMode bool `mapstructure:"safemode"`
31+ Dev []Dev `mapstructure:"dev"`
32+ History History `mapstructure:"history"`
33+ Debug bool `mapstructure:"debug"`
34+ Port int `mapstructure:"port"`
35+ Address string `mapstructure:"address"`
36+ Tiny bool `mapstructure:"tiny"`
37+ FlushTokenTime int `mapstructure:"flushTokenTime"`
38+ Workdirectory string `mapstructure:"-"`
39+ Databasepath string `mapstructure:"-"`
40+ ApiKey string `mapstructure:"api_key"`
41+ SafeMode bool `mapstructure:"safemode"`
4442}
4543
4644var (
@@ -71,11 +69,10 @@ func LoadConfig() (*AppConfig, error) {
7169 // Set default values
7270 v .SetDefault ("dev" , []Dev {
7371 {
74- Password : "" ,
75- Key : "a2ffa5c9be07488bbb04a3a47d3c5f6a" ,
76- IP : "192.168.31.1" ,
77- RouterUnit : false ,
78- IsLocal : false ,
72+ Password : "" ,
73+ Key : "a2ffa5c9be07488bbb04a3a47d3c5f6a" ,
74+ IP : "192.168.31.1" ,
75+ IsLocal : false ,
7976 },
8077 })
8178 v .SetDefault ("history.enable" , false )
@@ -85,7 +82,6 @@ func LoadConfig() (*AppConfig, error) {
8582 v .SetDefault ("port" , 6789 )
8683 v .SetDefault ("tiny" , false )
8784 v .SetDefault ("flushTokenTime" , 1800 )
88- v .SetDefault ("netdata_routernum" , 0 )
8985 v .SetDefault ("api_key" , "" )
9086 v .SetDefault ("safemode" , true )
9187 v .SetDefault ("address" , "0.0.0.0" )
0 commit comments