Mercurial > gemma
comparison pkg/imports/wx.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 |
---|---|
20 "errors" | 20 "errors" |
21 "fmt" | 21 "fmt" |
22 "io" | 22 "io" |
23 "time" | 23 "time" |
24 | 24 |
25 "gemma.intevation.de/gemma/pkg/common" | |
26 "gemma.intevation.de/gemma/pkg/wfs" | 25 "gemma.intevation.de/gemma/pkg/wfs" |
27 ) | 26 ) |
28 | 27 |
29 // WaterwayAxis is an import job to import | 28 // WaterwayAxis is an import job to import |
30 // the waterway axes in form of line string geometries | 29 // the waterway axes in form of line string geometries |
50 | 49 |
51 func (wxJobCreator) Description() string { return "waterway axis" } | 50 func (wxJobCreator) Description() string { return "waterway axis" } |
52 | 51 |
53 func (wxJobCreator) AutoAccept() bool { return true } | 52 func (wxJobCreator) AutoAccept() bool { return true } |
54 | 53 |
55 func (wxJobCreator) Create(data string) (Job, error) { | 54 func (wxJobCreator) Create() Job { return new(WaterwayAxis) } |
56 wx := new(WaterwayAxis) | |
57 if err := common.FromJSONString(data, wx); err != nil { | |
58 return nil, err | |
59 } | |
60 return wx, nil | |
61 } | |
62 | 55 |
63 func (wxJobCreator) Depends() []string { | 56 func (wxJobCreator) Depends() []string { |
64 return []string{ | 57 return []string{ |
65 "waterway_axis", | 58 "waterway_axis", |
66 } | 59 } |