summaryrefslogtreecommitdiffstats
path: root/model/client4.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/client4.go')
-rw-r--r--model/client4.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go
index 48a88e968..ec91460fd 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -112,6 +112,10 @@ func (c *Client4) GetPostRoute(postId string) string {
return fmt.Sprintf(c.GetPostsRoute()+"/%v", postId)
}
+func (c *Client4) GetSystemRoute() string {
+ return fmt.Sprintf("/system")
+}
+
func (c *Client4) DoApiGet(url string, etag string) (*http.Response, *AppError) {
return c.DoApiRequest(http.MethodGet, url, "", etag)
}
@@ -570,5 +574,14 @@ func (c *Client4) GetPostsForChannel(channelId string, page, perPage int, etag s
}
}
+func (c *Client4) GetPing() (bool, *Response) {
+ if r, err := c.DoApiGet(c.GetSystemRoute()+"/ping", ""); err != nil {
+ return false, &Response{StatusCode: r.StatusCode, Error: err}
+ } else {
+ defer closeBody(r)
+ return CheckStatusOK(r), BuildResponse(r)
+ }
+}
+
// Files Section
// to be filled in..