comparison pkg/imports/wa.go @ 2187:7c83b5277c1c

Import queue: Removed boilerplate code to deserialize jobs from JSON by making it part of the import queue.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 11 Feb 2019 18:35:01 +0100
parents b868cb653c4d
children 02505fcff63c
comparison
equal deleted inserted replaced
2186:d0498088894f 2187:7c83b5277c1c
21 "fmt" 21 "fmt"
22 "io" 22 "io"
23 "strconv" 23 "strconv"
24 "time" 24 "time"
25 25
26 "gemma.intevation.de/gemma/pkg/common"
27 "gemma.intevation.de/gemma/pkg/wfs" 26 "gemma.intevation.de/gemma/pkg/wfs"
28 ) 27 )
29 28
30 // WaterwayArea is an import job to import 29 // WaterwayArea is an import job to import
31 // the waterway area in form of polygon geometries 30 // the waterway area in form of polygon geometries
51 50
52 func (waJobCreator) Description() string { return "waterway area" } 51 func (waJobCreator) Description() string { return "waterway area" }
53 52
54 func (waJobCreator) AutoAccept() bool { return true } 53 func (waJobCreator) AutoAccept() bool { return true }
55 54
56 func (waJobCreator) Create(data string) (Job, error) { 55 func (waJobCreator) Create() Job { return new(WaterwayArea) }
57 wa := new(WaterwayArea)
58 if err := common.FromJSONString(data, wa); err != nil {
59 return nil, err
60 }
61 return wa, nil
62 }
63 56
64 func (waJobCreator) Depends() []string { 57 func (waJobCreator) Depends() []string {
65 return []string{ 58 return []string{
66 "waterway_area", 59 "waterway_area",
67 } 60 }