diff options
author | Carlos Tadeu Panato Junior <ctadeu@gmail.com> | 2017-03-14 17:06:07 +0100 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-03-14 16:06:07 +0000 |
commit | fa47132b8f1d6d889450021f6afbdc903208ac41 (patch) | |
tree | 128ff3b7563e3fcef45c0ddc07704335566eb881 /model/client4.go | |
parent | a1994cf7ce3d660edd4be4a470b1239443a99275 (diff) | |
download | chat-fa47132b8f1d6d889450021f6afbdc903208ac41.tar.gz chat-fa47132b8f1d6d889450021f6afbdc903208ac41.tar.bz2 chat-fa47132b8f1d6d889450021f6afbdc903208ac41.zip |
[APIV4] POST /caches/invalidate - endpoint for apiV4 (#5756)
Diffstat (limited to 'model/client4.go')
-rw-r--r-- | model/client4.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go index df09174d5..8f3328e80 100644 --- a/model/client4.go +++ b/model/client4.go @@ -154,6 +154,10 @@ func (c *Client4) GetDatabaseRoute() string { return fmt.Sprintf("/database") } +func (c *Client4) GetCacheRoute() string { + return fmt.Sprintf("/caches") +} + func (c *Client4) GetClusterRoute() string { return fmt.Sprintf("/cluster") } @@ -1154,6 +1158,15 @@ func (c *Client4) DatabaseRecycle() (bool, *Response) { } } +func (c *Client4) InvalidateCaches() (bool, *Response) { + if r, err := c.DoApiPost(c.GetCacheRoute()+"/invalidate", ""); err != nil { + return false, &Response{StatusCode: r.StatusCode, Error: err} + } else { + defer closeBody(r) + return CheckStatusOK(r), BuildResponse(r) + } +} + // Webhooks Section // CreateIncomingWebhook creates an incoming webhook for a channel. |