MCPcopy Index your code
hub / github.com/coder/coder / UpdateCheck

Method UpdateCheck

codersdk/updatecheck.go:21–34  ·  view source on GitHub ↗

UpdateCheck returns information about the latest release version of Coder and whether or not the server is running the latest release.

(ctx context.Context)

Source from the content-addressed store, hash-verified

19// UpdateCheck returns information about the latest release version of
20// Coder and whether or not the server is running the latest release.
21func (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}

Callers 1

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1