diff options
Diffstat (limited to 'config.go')
-rw-r--r-- | config.go | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -13,6 +13,13 @@ type Config struct { Limit int `json:limit` Interval string `json:interval` Epsilon float64 `json:epsilon` + + DBConn string `json:DBConn` + DBName string `json:DBName` + RawTable string `json:rawTable` + CleanTable string `json:cleanTable` + DBUser string `json:DBUser` + DBPass string `json:DBPass` } func (cfg *Config) getInterval() (interval time.Duration, err error) { @@ -31,12 +38,12 @@ func (cfg *Config) getInterval() (interval time.Duration, err error) { return } -func readConfig() (conf Config, err error) { +func readConfig() (cfg *Config, err error) { content, err := ioutil.ReadFile("config.json") if err != nil { log.Println(err) } - err = json.Unmarshal(content, &conf) + err = json.Unmarshal(content, &cfg) if err != nil { log.Println(err) } |