From 7ca22dc3e6a5fb1815de2c42b868458e1efb9ef9 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 5 Feb 2018 17:47:03 +0100 Subject: Adds detection of expired offers. --- config.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'config.go') diff --git a/config.go b/config.go index 30387a3..2706201 100644 --- a/config.go +++ b/config.go @@ -9,11 +9,13 @@ type Config struct { DBDriver string DBDBName string DBHost string - DBPort int + DBPort string DBUser string DBPassword string DBOptions string DBPath string // for sqlite + + Debug bool } // Parses the configuration and sets the configuration struct. @@ -21,11 +23,13 @@ func (c *Config) parseConfig(configFile string) { viper.SetDefault("DBDriver", "mysql") viper.SetDefault("DBDBName", "alkobote") - viper.SetDefault("DBHost", "127.0.0.1") - viper.SetDefault("DBPort", 3306) + viper.SetDefault("DBHost", "localhost") + viper.SetDefault("DBPort", "3306") viper.SetDefault("DBPath", "./alkobote.db") + viper.SetDefault("Debug", false) + // Name of the configuration file viper.SetConfigName("config") @@ -62,10 +66,11 @@ func (c *Config) parseConfig(configFile string) { func (c *Config) setsConfig() { c.DBDriver = viper.GetString("DBDriver") c.DBHost = viper.GetString("DBHost") - c.DBPort = viper.GetInt("DBPort") + c.DBPort = viper.GetString("DBPort") c.DBUser = viper.GetString("DBUser") c.DBPassword = viper.GetString("DBPassword") c.DBDBName = viper.GetString("DBDBName") c.DBOptions = viper.GetString("DBOptions") - c.DBOptions = viper.GetString("DBPath") + c.DBPath = viper.GetString("DBPath") + c.Debug = viper.GetBool("Debug") } -- cgit v1.2.3