forked from hishamkaram/geoserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcapabilities.go
More file actions
26 lines (24 loc) · 780 Bytes
/
capabilities.go
File metadata and controls
26 lines (24 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package geoserver
import (
"github.com/hishamkaram/geoserver/wms"
)
//GetCapabilities Retrieves metadata about the service, including supported operations and parameters,
//and a list of the available layers
func (g *GeoServer) GetCapabilities(workspaceName string) (cap *wms.Capabilities, err error) {
targetURL := g.ParseURL(workspaceName, "wms")
httpRequest := HTTPRequest{
Method: getMethod,
Accept: appXMLType,
URL: targetURL,
Query: map[string]string{"service": "wms", "version": "1.1.1", "request": "GetCapabilities"},
}
response, responseCode := g.DoRequest(httpRequest)
if responseCode != statusOk {
g.logger.Error(string(response))
cap = nil
err = g.GetError(responseCode, response)
return
}
cap = wms.ParseCapabilities(response)
return
}