From dd48edbc9834eef46b6590439a61c7fa0242c8db Mon Sep 17 00:00:00 2001 From: horus Date: Mon, 19 Feb 2018 21:43:54 +0100 Subject: Adds config option to crawl only specific shops. (crawler) --- crawler/config.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crawler/config.go') diff --git a/crawler/config.go b/crawler/config.go index f74253e..27aaa45 100644 --- a/crawler/config.go +++ b/crawler/config.go @@ -20,6 +20,7 @@ type Config struct { Debug bool FixDatabase bool + ShopIDs []string } // Parses the configuration and sets the configuration struct. @@ -35,6 +36,7 @@ func (c *Config) parseConfig(configFile string) { viper.SetDefault("Debug", false) viper.SetDefault("FixDatabase", false) viper.SetDefault("DisableURLShorter", false) + viper.SetDefault("ShopIDs", []string{}) // Name of the configuration file viper.SetConfigName("config") @@ -77,6 +79,7 @@ func (c *Config) setsConfig() { c.Debug = viper.GetBool("Debug") c.FixDatabase = viper.GetBool("FixDatabase") c.DisableURLShorter = viper.GetBool("DisableURLShorter") + c.ShopIDs = viper.GetStringSlice("ShopIDs") c.Polr_URL = viper.GetString("Polr_URL") c.Polr_API_Key = viper.GetString("Polr_API_Key") } -- cgit v1.2.3