UpdateCheck returns information about the latest release version of Coder and whether or not the server is running the latest release.
(ctx context.Context)
| 19 | // UpdateCheck returns information about the latest release version of |
| 20 | // Coder and whether or not the server is running the latest release. |
| 21 | func (c *Client) UpdateCheck(ctx context.Context) (UpdateCheckResponse, error) { |
| 22 | res, err := c.Request(ctx, http.MethodGet, "/api/v2/updatecheck", nil) |
| 23 | if err != nil { |
| 24 | return UpdateCheckResponse{}, err |
| 25 | } |
| 26 | defer res.Body.Close() |
| 27 | |
| 28 | if res.StatusCode != http.StatusOK { |
| 29 | return UpdateCheckResponse{}, ReadBodyAsError(res) |
| 30 | } |
| 31 | |
| 32 | var buildInfo UpdateCheckResponse |
| 33 | return buildInfo, json.NewDecoder(res.Body).Decode(&buildInfo) |
| 34 | } |