# HG changeset patch # User Sascha L. Teichmann # Date 1548346874 -3600 # Node ID 8a62ce2a5c701a136d830ce3def1a7867cc61ab4 # Parent 1324dd12af9ef3986cc8996327e99f77f9232c26 Moved gaugemeasurement to local package. diff -r 1324dd12af9e -r 8a62ce2a5c70 pkg/imports/gm.go --- 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) { diff -r 1324dd12af9e -r 8a62ce2a5c70 pkg/models/gauge.go --- 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 - -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 -} diff -r 1324dd12af9e -r 8a62ce2a5c70 pkg/models/imports.go --- 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"` +}