comparison pkg/controllers/publish.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
children 11d80120ed3d
comparison
equal deleted inserted replaced
472:39b5deee8810 473:b2dea4e56ff1
1 package controllers
2
3 import (
4 "database/sql"
5 "net/http"
6
7 "gemma.intevation.de/gemma/pkg/models"
8 )
9
10 func published(_ interface{}, req *http.Request, _ *sql.DB) (jr JSONResult, err error) {
11 jr = JSONResult{
12 Result: struct {
13 Internal []models.PubEntry `json:"internal"`
14 External []models.ExtEntry `json:"external"`
15 }{
16 Internal: models.PublishedServices.Filter(models.PublishedAll),
17 External: models.ExternalServices.Filter(models.ExternalAll),
18 },
19 }
20 return
21 }