[APIV4] POST /caches/invalidate - endpoint for apiV4 (#5756)
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
a1994cf7ce
Коммит
fa47132b8f
@@ -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.
|
||||
|
||||
Ссылка в новой задаче
Block a user