From 8a94fd9d4b54e05ecd11ce4bc1fd9b0feb92b239 Mon Sep 17 00:00:00 2001 From: horus_arch Date: Sat, 17 Feb 2018 15:22:51 +0100 Subject: Sets config option to disable url shorter. (crawler) --- crawler/config.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'crawler/config.go') diff --git a/crawler/config.go b/crawler/config.go index 2eb7d03..c9b17a4 100644 --- a/crawler/config.go +++ b/crawler/config.go @@ -5,16 +5,17 @@ import ( ) type Config struct { - DBDriver string - DBDBName string - DBHost string - DBPort string - DBUser string - DBPassword string - DBOptions string - DBPath string // for sqlite - Polr_URL string - Polr_API_Key string + DBDriver string + DBDBName string + DBHost string + DBPort string + DBUser string + DBPassword string + DBOptions string + DBPath string // for sqlite + DisableURLShorter bool + Polr_URL string + Polr_API_Key string Debug bool } @@ -30,6 +31,7 @@ func (c *Config) parseConfig(configFile string) { viper.SetDefault("DB_Path", "./alkobote.db") viper.SetDefault("Debug", false) + viper.SetDefault("DisableURLShorter", false) // Name of the configuration file viper.SetConfigName("config") @@ -70,6 +72,7 @@ func (c *Config) setsConfig() { c.DBOptions = viper.GetString("DB_Options") c.DBPath = viper.GetString("DB_Path") c.Debug = viper.GetBool("Debug") + c.DisableURLShorter = viper.GetBool("DisableURLShorter") c.Polr_URL = viper.GetString("Polr_URL") c.Polr_API_Key = viper.GetString("Polr_API_Key") } -- cgit v1.2.3