Mercurial > gemma
comparison pkg/models/extservices.go @ 473:b2dea4e56ff1
/api/published (GET) returns a JSON document of the geo-services published by the gemma server.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 23 Aug 2018 13:24:26 +0200 |
parents | 25dd96101aeb |
children | c10c76c92797 |
comparison
equal
deleted
inserted
replaced
472:39b5deee8810 | 473:b2dea4e56ff1 |
---|---|
8 | 8 |
9 "gemma.intevation.de/gemma/pkg/auth" | 9 "gemma.intevation.de/gemma/pkg/auth" |
10 ) | 10 ) |
11 | 11 |
12 type ExtEntry struct { | 12 type ExtEntry struct { |
13 Name string | 13 Name string `json:"name"` |
14 URL string | 14 URL string `json:"url"` |
15 WFS bool | 15 WFS bool `json:"wfs"` |
16 } | 16 } |
17 | 17 |
18 type ExtServices struct { | 18 type ExtServices struct { |
19 mu sync.Mutex | 19 mu sync.Mutex |
20 entries []ExtEntry | 20 entries []ExtEntry |
72 es.mu.Lock() | 72 es.mu.Lock() |
73 es.entries = nil | 73 es.entries = nil |
74 es.mu.Unlock() | 74 es.mu.Unlock() |
75 } | 75 } |
76 | 76 |
77 func ExternalWMS(entry PubEntry) bool { return !entry.WFS } | 77 func ExternalAll(ExtEntry) bool { return true } |
78 func ExternalWFS(entry PubEntry) bool { return entry.WFS } | 78 func ExternalWMS(entry ExtEntry) bool { return !entry.WFS } |
79 func ExternalWFS(entry ExtEntry) bool { return entry.WFS } | |
79 | 80 |
80 func (es *ExtServices) Filter(accept func(ExtEntry) bool) []ExtEntry { | 81 func (es *ExtServices) Filter(accept func(ExtEntry) bool) []ExtEntry { |
81 es.mu.Lock() | 82 es.mu.Lock() |
82 defer es.mu.Unlock() | 83 defer es.mu.Unlock() |
83 if es.entries == nil { | 84 if es.entries == nil { |