diff pkg/controllers/manualimports.go @ 1808:77582da3adb0

Waterway gauges import: Added stub.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 15 Jan 2019 16:51:38 +0100
parents 614c6c766691
children 491f5b68da9e
line wrap: on
line diff
--- a/pkg/controllers/manualimports.go	Tue Jan 15 14:51:44 2019 +0100
+++ b/pkg/controllers/manualimports.go	Tue Jan 15 16:51:38 2019 +0100
@@ -87,6 +87,21 @@
 	return wa, due, retries, wai.SendEmail
 }
 
+func importWaterwayGauge(input interface{}) (interface{}, time.Time, int, bool) {
+	wgi := input.(*models.WaterwayGaugeImport)
+	username, _ := wgi.Attributes.Get("username")
+	password, _ := wgi.Attributes.Get("password")
+	insecure := wgi.Attributes.Bool("insecure")
+	wg := &imports.WaterwayGauge{
+		URL:      wgi.URL,
+		Username: username,
+		Password: password,
+		Insecure: insecure,
+	}
+	due, retries := retry(wgi.Attributes)
+	return wg, due, retries, wgi.SendEmail
+}
+
 func manualImport(
 	kind imports.JobKind,
 	setup func(interface{}) (interface{}, time.Time, int, bool),