diff options
| author | horus | 2018-09-16 17:17:04 +0200 |
|---|---|---|
| committer | horus | 2018-09-16 17:17:04 +0200 |
| commit | d1ce36763bb1f5dc3d4f58b59a20cffc2b03a3a4 (patch) | |
| tree | b87dd41ba45240c746ee1cea823f918a3f2be209 /crawler/config.go | |
| parent | 03682685add64a9dd307a3d99b49717446b11b9d (diff) | |
| download | alkobote-d1ce36763bb1f5dc3d4f58b59a20cffc2b03a3a4.tar.gz | |
Rename flags. Adds new flag to exclude shops. (crawler)
Diffstat (limited to 'crawler/config.go')
| -rw-r--r-- | crawler/config.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crawler/config.go b/crawler/config.go index a3939c4..ba3c92f 100644 --- a/crawler/config.go +++ b/crawler/config.go @@ -25,9 +25,10 @@ type Config struct { Polr_URL string Polr_API_Key string - Debug bool // sets log level to debug - FixDatabase bool // reruns some sanitizing functions over the db - ShopIDs []string // limits which shops to crawl, wants shop_id + Debug bool // sets log level to debug + FixDatabase bool // reruns some sanitizing functions over the db + ShopIDs []string // limits which shops to crawl, wants shop_id + ExcludeShopIDs []string // excludes shops from being crawled, wants shop_id } // Parses the configuration and sets the configuration struct. @@ -44,6 +45,7 @@ func (c *Config) parseConfig(configFile string) { viper.SetDefault("FixDatabase", false) viper.SetDefault("DisableURLShorter", false) viper.SetDefault("ShopIDs", []string{}) + viper.SetDefault("ExcludeShopIDs", []string{}) viper.SetDefault("Delay", 0) // needs some refactoring to truly respect robots.txt @@ -117,4 +119,5 @@ func (c *Config) setsConfig() { c.Debug = viper.GetBool("Debug") c.FixDatabase = viper.GetBool("FixDatabase") c.ShopIDs = viper.GetStringSlice("ShopIDs") + c.ExcludeShopIDs = viper.GetStringSlice("ExcludeShopIDs") } |
