diff pkg/config/config.go @ 874:da526b58c9c4 geo-style

Added a flag geoserver-clean to force deletion of the gemma workspace before configuring the GeoServer again.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 30 Sep 2018 15:36:17 +0200
parents 7e45aaec7081
children 2818ad6c7d32
line wrap: on
line diff
--- a/pkg/config/config.go	Sun Sep 30 14:24:37 2018 +0200
+++ b/pkg/config/config.go	Sun Sep 30 15:36:17 2018 +0200
@@ -45,6 +45,7 @@
 func GeoServerURL() string      { return viper.GetString("geoserver-url") }
 func GeoServerUser() string     { return viper.GetString("geoserver-user") }
 func GeoServerPassword() string { return viper.GetString("geoserver-password") }
+func GeoServerClean() bool      { return viper.GetBool("geoserver-clean") }
 
 var (
 	proxyKeyOnce sync.Once
@@ -116,6 +117,10 @@
 		fl.StringSlice(name, value, usage)
 		vbind(name)
 	}
+	bl := func(name string, value bool, usage string) {
+		fl.Bool(name, value, usage)
+		vbind(name)
+	}
 
 	strP("db-host", "H", "localhost", "host of the database")
 	uiP("db-port", "P", 5432, "port of the database")
@@ -143,6 +148,7 @@
 	str("geoserver-url", "http://localhost:8080/geoserver", "URL to GeoServer")
 	str("geoserver-user", "admin", "GeoServer user")
 	str("geoserver-password", "geoserver", "GeoServer password")
+	bl("geoserver-clean", false, "Clean GeoServer setup")
 
 	str("proxy-key", "", `signing key for proxy URLs. Defaults to random key.`)
 	str("proxy-prefix", "", `URL prefix of proxy. Defaults to "http://${web-host}:${web-port}"`)