Mercurial > gemma
comparison pkg/imports/sec.go @ 4798:ca6a5f722471
Added Description method to most imports.
Only for imports where information relevant to the administrator is
relevant.
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Fri, 25 Oct 2019 18:25:38 +0200 |
parents | 2336f75637d1 |
children | f32d086b5dbf |
comparison
equal
deleted
inserted
replaced
4797:9a4f5f319419 | 4798:ca6a5f722471 |
---|---|
14 package imports | 14 package imports |
15 | 15 |
16 import ( | 16 import ( |
17 "context" | 17 "context" |
18 "database/sql" | 18 "database/sql" |
19 "strings" | |
19 "time" | 20 "time" |
20 | 21 |
21 "gemma.intevation.de/gemma/pkg/models" | 22 "gemma.intevation.de/gemma/pkg/models" |
22 ) | 23 ) |
23 | 24 |
29 Tolerance float32 `json:"tolerance"` | 30 Tolerance float32 `json:"tolerance"` |
30 ObjNam string `json:"objnam"` | 31 ObjNam string `json:"objnam"` |
31 NObjNam *string `json:"nobjnam"` | 32 NObjNam *string `json:"nobjnam"` |
32 Source string `json:"source-organization"` | 33 Source string `json:"source-organization"` |
33 Date models.Date `json:"date-info"` | 34 Date models.Date `json:"date-info"` |
35 } | |
36 | |
37 func (sec *Section) Description() (string, error) { | |
38 | |
39 var descs []string | |
40 | |
41 descs = append(descs, sec.Name) | |
42 descs = append(descs, sec.ObjNam) | |
43 descs = append(descs, sec.From.String()) | |
44 descs = append(descs, sec.To.String()) | |
45 return strings.Join(descs, "|"), nil | |
34 } | 46 } |
35 | 47 |
36 // SECJobKind is the import queue type identifier. | 48 // SECJobKind is the import queue type identifier. |
37 const SECJobKind JobKind = "sec" | 49 const SECJobKind JobKind = "sec" |
38 | 50 |