-
Notifications
You must be signed in to change notification settings - Fork 24
/
about.go
29 lines (27 loc) · 801 Bytes
/
about.go
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
27
28
29
package geoserver
// AboutService define all geoserver About operations
type AboutService interface {
//IsRunning check if geoserver is running return true and error if if error occure
IsRunning() (running bool, err error)
}
//IsRunning check if geoserver is running \n
//return true if geoserver running,
//and false if not runnging,
//err is an error if error occurredÎ
func (g *GeoServer) IsRunning() (running bool, err error) {
targetURL := g.ParseURL("rest", "about", "version")
httpRequest := HTTPRequest{
URL: targetURL,
Method: getMethod,
Accept: jsonType,
}
response, responseCode := g.DoRequest(httpRequest)
if responseCode != statusOk {
g.logger.Error(string(response))
err = g.GetError(responseCode, response)
running = false
return
}
running = true
return
}