diff options
| author | horus | 2018-02-19 21:43:54 +0100 |
|---|---|---|
| committer | horus | 2018-02-19 21:43:54 +0100 |
| commit | dd48edbc9834eef46b6590439a61c7fa0242c8db (patch) | |
| tree | 5af98d7ec7de633c97024756c13fa9bad0bd7436 /crawler/config.go | |
| parent | c2bf9dc1d1cccc2d4cf7a1a2e1ce15eea7da6624 (diff) | |
| download | alkobote-dd48edbc9834eef46b6590439a61c7fa0242c8db.tar.gz | |
Adds config option to crawl only specific shops. (crawler)
Diffstat (limited to 'crawler/config.go')
| -rw-r--r-- | crawler/config.go | 3 |
1 files changed, 3 insertions, 0 deletions
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") } |
