Mercurial > gemma
comparison pkg/imports/sr.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 | 1ec4c5633eb6 |
comparison
equal
deleted
inserted
replaced
2186:d0498088894f | 2187:7c83b5277c1c |
---|---|
75 | 75 |
76 func (srJobCreator) Description() string { return "sounding results" } | 76 func (srJobCreator) Description() string { return "sounding results" } |
77 | 77 |
78 func (srJobCreator) AutoAccept() bool { return false } | 78 func (srJobCreator) AutoAccept() bool { return false } |
79 | 79 |
80 func (srJobCreator) Create(data string) (Job, error) { | 80 func (srJobCreator) Create() Job { return new(SoundingResult) } |
81 sr := new(SoundingResult) | |
82 if err := common.FromJSONString(data, sr); err != nil { | |
83 return nil, err | |
84 } | |
85 return sr, nil | |
86 } | |
87 | 81 |
88 func (srJobCreator) Depends() []string { | 82 func (srJobCreator) Depends() []string { |
89 return []string{ | 83 return []string{ |
90 "sounding_results", | 84 "sounding_results", |
91 "sounding_results_contour_lines", | 85 "sounding_results_contour_lines", |