summaryrefslogtreecommitdiff
path: root/crawler/config.go
diff options
context:
space:
mode:
authorhorus2018-02-19 21:43:54 +0100
committerhorus2018-02-19 21:43:54 +0100
commitdd48edbc9834eef46b6590439a61c7fa0242c8db (patch)
tree5af98d7ec7de633c97024756c13fa9bad0bd7436 /crawler/config.go
parentc2bf9dc1d1cccc2d4cf7a1a2e1ce15eea7da6624 (diff)
downloadalkobote-dd48edbc9834eef46b6590439a61c7fa0242c8db.tar.gz
Adds config option to crawl only specific shops. (crawler)
Diffstat (limited to 'crawler/config.go')
-rw-r--r--crawler/config.go3
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")
}