comparison pkg/imports/dmv.go @ 1855:bbd653a43a6a

Distance marks virtual import: Added stub.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 17 Jan 2019 11:45:33 +0100
parents
children 9780cb4ef6a6
comparison
equal deleted inserted replaced
1854:79283856f9cb 1855:bbd653a43a6a
1 // This is Free Software under GNU Affero General Public License v >= 3.0
2 // without warranty, see README.md and license for details.
3 //
4 // SPDX-License-Identifier: AGPL-3.0-or-later
5 // License-Filename: LICENSES/AGPL-3.0.txt
6 //
7 // Copyright (C) 2018 by via donau
8 // – Österreichische Wasserstraßen-Gesellschaft mbH
9 // Software engineering by Intevation GmbH
10 //
11 // Author(s):
12 // * Sascha L. Teichmann <sascha.teichmann@intevation.de>
13
14 package imports
15
16 import (
17 "context"
18 "database/sql"
19 "errors"
20
21 "gemma.intevation.de/gemma/pkg/common"
22 )
23
24 type DistanceMarksVirtual struct {
25 // URL is the URL of the SOAP service.
26 URL string `json:"url"`
27 // Username is the username used to authenticate.
28 Username string `json:"username"`
29 // Passwort is the password to authenticate.
30 Password string `json:"password"`
31 // Insecure indicates if HTTPS traffic
32 // should validate certificates or not.
33 Insecure bool `json:"insecure"`
34 }
35
36 const DMVJobKind JobKind = "dmv"
37
38 type dmvJobCreator struct{}
39
40 func init() {
41 RegisterJobCreator(DMVJobKind, dmvJobCreator{})
42 }
43
44 func (dmvJobCreator) Description() string { return "distance marks virtual" }
45
46 func (dmvJobCreator) AutoAccept() bool { return true }
47
48 func (dmvJobCreator) Create(_ JobKind, data string) (Job, error) {
49 dmv := new(DistanceMarksVirtual)
50 if err := common.FromJSONString(data, dmv); err != nil {
51 return nil, err
52 }
53 return dmv, nil
54 }
55
56 func (dmvJobCreator) Depends() []string {
57 return []string{
58 "distance_marks_virtual",
59 }
60 }
61
62 // StageDone does nothing as there is no staging for distance marks virtual.
63 func (dmvJobCreator) StageDone(context.Context, *sql.Tx, int64) error { return nil }
64
65 // CleanUp does nothing as there is nothing to cleanup with distance marks virtual.
66 func (*DistanceMarksVirtual) CleanUp() error { return nil }
67
68 func (dmv *DistanceMarksVirtual) Do(
69 ctx context.Context,
70 importID int64,
71 conn *sql.Conn,
72 feedback Feedback,
73 ) (interface{}, error) {
74
75 // TODO: Implement me!
76
77 return nil, errors.New("Not implemented, yet!")
78 }