summaryrefslogtreecommitdiff
path: root/crawler/config.go
diff options
context:
space:
mode:
authorhorus2018-02-21 01:37:40 +0100
committerhorus2018-02-21 01:37:40 +0100
commit73634fea62cac6e50803e27df5848c72b6dc30fa (patch)
treec4660d8e02eda987c0ca0b7e6f4ea79f1349c24a /crawler/config.go
parent2cb42642b670d2b526a8afe16dead096738be094 (diff)
downloadalkobote-73634fea62cac6e50803e27df5848c72b6dc30fa.tar.gz
Adds some docu. (crawler)
Diffstat (limited to 'crawler/config.go')
-rw-r--r--crawler/config.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/crawler/config.go b/crawler/config.go
index 9ee95b7..f89fa45 100644
--- a/crawler/config.go
+++ b/crawler/config.go
@@ -21,9 +21,9 @@ type Config struct {
Polr_URL string
Polr_API_Key string
- Debug bool
- FixDatabase bool
- ShopIDs []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
}
// Parses the configuration and sets the configuration struct.
@@ -56,12 +56,15 @@ func (c *Config) parseConfig(configFile string) {
// provided config file does not exist, so we add the path instead
viper.AddConfigPath(configFile)
} else if err == nil && stat.IsDir() {
+ // adds the path to look for the config file
viper.AddConfigPath(configFile)
} else if err == nil {
// directly sets the config file
viper.SetConfigFile(configFile)
} else {
- Warn(err, "config.go: os.Stat("+configFile+")")
+ // if we are here something went wrong
+ Warn(err, "config.go: os.Stat("+configFile+") error")
+ // adding the path nonetheless because it's not hurting
viper.AddConfigPath(configFile)
}
}