Mercurial > gemma
comparison pkg/imports/wg.go @ 4182:49012340336c
Made 'golint' finally happy with imports package.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 06 Aug 2019 11:13:28 +0200 |
parents | c489c78ed525 |
children | 5d7ce7f926eb |
comparison
equal
deleted
inserted
replaced
4181:bd97dc2dceea | 4182:49012340336c |
---|---|
24 "gemma.intevation.de/gemma/pkg/models" | 24 "gemma.intevation.de/gemma/pkg/models" |
25 "gemma.intevation.de/gemma/pkg/pgxutils" | 25 "gemma.intevation.de/gemma/pkg/pgxutils" |
26 "gemma.intevation.de/gemma/pkg/soap/erdms" | 26 "gemma.intevation.de/gemma/pkg/soap/erdms" |
27 ) | 27 ) |
28 | 28 |
29 // WaterwayGauge is a Job to load gauge data from | |
30 // a specified NTS service and stores them into the database. | |
29 type WaterwayGauge struct { | 31 type WaterwayGauge struct { |
30 // URL is the URL of the SOAP service. | 32 // URL is the URL of the SOAP service. |
31 URL string `json:"url"` | 33 URL string `json:"url"` |
32 // Username is the username used to authenticate. | 34 // Username is the username used to authenticate. |
33 Username string `json:"username"` | 35 Username string `json:"username"` |
36 // Insecure indicates if HTTPS traffic | 38 // Insecure indicates if HTTPS traffic |
37 // should validate certificates or not. | 39 // should validate certificates or not. |
38 Insecure bool `json:"insecure"` | 40 Insecure bool `json:"insecure"` |
39 } | 41 } |
40 | 42 |
43 // WGJobKind is the unique name of this import job type. | |
41 const WGJobKind JobKind = "wg" | 44 const WGJobKind JobKind = "wg" |
42 | 45 |
43 type wgJobCreator struct{} | 46 type wgJobCreator struct{} |
44 | 47 |
45 func init() { | 48 func init() { RegisterJobCreator(WGJobKind, wgJobCreator{}) } |
46 RegisterJobCreator(WGJobKind, wgJobCreator{}) | |
47 } | |
48 | 49 |
49 func (wgJobCreator) Description() string { return "waterway gauges" } | 50 func (wgJobCreator) Description() string { return "waterway gauges" } |
50 | 51 |
51 func (wgJobCreator) AutoAccept() bool { return true } | 52 func (wgJobCreator) AutoAccept() bool { return true } |
52 | 53 |
169 ) ON CONFLICT (location, validity, depth_reference) DO UPDATE SET | 170 ) ON CONFLICT (location, validity, depth_reference) DO UPDATE SET |
170 value = EXCLUDED.value | 171 value = EXCLUDED.value |
171 ` | 172 ` |
172 ) | 173 ) |
173 | 174 |
175 // Do implements the actual import. | |
174 func (wg *WaterwayGauge) Do( | 176 func (wg *WaterwayGauge) Do( |
175 ctx context.Context, | 177 ctx context.Context, |
176 importID int64, | 178 importID int64, |
177 conn *sql.Conn, | 179 conn *sql.Conn, |
178 feedback Feedback, | 180 feedback Feedback, |