changeset 2018:8a62ce2a5c70 unify_imports

Moved gaugemeasurement to local package.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 24 Jan 2019 17:21:14 +0100
parents 1324dd12af9e
children aeff01c6edec
files pkg/imports/gm.go pkg/models/gauge.go pkg/models/imports.go
diffstat 3 files changed, 18 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/imports/gm.go	Thu Jan 24 17:15:04 2019 +0100
+++ b/pkg/imports/gm.go	Thu Jan 24 17:21:14 2019 +0100
@@ -35,6 +35,12 @@
 	Insecure bool `json:"insecure"`
 }
 
+// gaugeMeasurement holds information about a gauge and the latest measurement
+type gaugeMeasurement struct {
+	Gauge           models.Isrs
+	LatestDateIssue time.Time
+}
+
 // GMJobKind is the import queue type identifier.
 const GMJobKind JobKind = "gm"
 
@@ -157,10 +163,10 @@
 	}
 	defer rows.Close()
 
-	gauges := []models.GaugeMeasurement{}
+	gauges := []gaugeMeasurement{}
 
 	for rows.Next() {
-		var g models.GaugeMeasurement
+		var g gaugeMeasurement
 		if err = rows.Scan(
 			&g.Gauge.CountryCode,
 			&g.Gauge.LoCode,
@@ -224,7 +230,7 @@
 
 func (gm *GaugeMeasurement) doForGM(
 	ctx context.Context,
-	gauges []models.GaugeMeasurement,
+	gauges []gaugeMeasurement,
 	conn *sql.Conn,
 	feedback Feedback,
 ) ([]string, error) {
--- a/pkg/models/gauge.go	Thu Jan 24 17:15:04 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// This is Free Software under GNU Affero General Public License v >= 3.0
-// without warranty, see README.md and license for details.
-//
-// SPDX-License-Identifier: AGPL-3.0-or-later
-// License-Filename: LICENSES/AGPL-3.0.txt
-//
-// Copyright (C) 2018 by via donau
-//   – Österreichische Wasserstraßen-Gesellschaft mbH
-// Software engineering by Intevation GmbH
-//
-// Author(s):
-//  * Raimund Renkert <raimund.renkert@intevation.de>
-
-package models
-
-import (
-	"time"
-
-	"gemma.intevation.de/gemma/pkg/common"
-)
-
-// GaugeMeasurementImport contains data used to define the endpoint
-type GaugeMeasurementImport struct {
-	URL       string `json:"url"`
-	Insecure  bool   `json:"insecure"`
-	SendEmail bool   `json:"send-email"`
-	// Attributes are optional attributes.
-	Attributes common.Attributes `json:"attributes,omitempty"`
-}
-
-// GaugeMeasurement holds information about a gauge and the latest measurement
-type GaugeMeasurement struct {
-	Gauge           Isrs
-	LatestDateIssue time.Time
-}
--- a/pkg/models/imports.go	Thu Jan 24 17:15:04 2019 +0100
+++ b/pkg/models/imports.go	Thu Jan 24 17:21:14 2019 +0100
@@ -20,3 +20,12 @@
 	SendEmail  bool              `json:"send-email"`
 	Attributes common.Attributes `json:"attributes,omitempty"`
 }
+
+// GaugeMeasurementImport contains data used to define the endpoint
+type GaugeMeasurementImport struct {
+	URL       string `json:"url"`
+	Insecure  bool   `json:"insecure"`
+	SendEmail bool   `json:"send-email"`
+	// Attributes are optional attributes.
+	Attributes common.Attributes `json:"attributes,omitempty"`
+}