summaryrefslogtreecommitdiff
path: root/crawler/config.go
diff options
context:
space:
mode:
authorhorus2018-02-19 21:22:30 +0100
committerhorus2018-02-19 21:22:30 +0100
commit6b509b3997c8de0181787224090af98768e3e735 (patch)
treeabf1682af200d7537ce1b15e34900a0e08f58e92 /crawler/config.go
parentf95995af8364ab9fd7106c050455e2d1f71c7ecd (diff)
downloadalkobote-6b509b3997c8de0181787224090af98768e3e735.tar.gz
Adds repair function. (crawler)
Diffstat (limited to 'crawler/config.go')
-rw-r--r--crawler/config.go22
1 files changed, 13 insertions, 9 deletions
diff --git a/crawler/config.go b/crawler/config.go
index c9b17a4..f74253e 100644
--- a/crawler/config.go
+++ b/crawler/config.go
@@ -5,19 +5,21 @@ import (
)
type Config struct {
- DBDriver string
- DBDBName string
- DBHost string
- DBPort string
- DBUser string
- DBPassword string
- DBOptions string
- DBPath string // for sqlite
+ DBDriver string
+ DBDBName string
+ DBHost string
+ DBPort string
+ DBUser string
+ DBPassword string
+ DBOptions string
+ DBPath string // for sqlite
+
DisableURLShorter bool
Polr_URL string
Polr_API_Key string
- Debug bool
+ Debug bool
+ FixDatabase bool
}
// Parses the configuration and sets the configuration struct.
@@ -31,6 +33,7 @@ func (c *Config) parseConfig(configFile string) {
viper.SetDefault("DB_Path", "./alkobote.db")
viper.SetDefault("Debug", false)
+ viper.SetDefault("FixDatabase", false)
viper.SetDefault("DisableURLShorter", false)
// Name of the configuration file
@@ -72,6 +75,7 @@ func (c *Config) setsConfig() {
c.DBOptions = viper.GetString("DB_Options")
c.DBPath = viper.GetString("DB_Path")
c.Debug = viper.GetBool("Debug")
+ c.FixDatabase = viper.GetBool("FixDatabase")
c.DisableURLShorter = viper.GetBool("DisableURLShorter")
c.Polr_URL = viper.GetString("Polr_URL")
c.Polr_API_Key = viper.GetString("Polr_API_Key")