BuildInfo returns build information for this instance of Coder.
(ctx context.Context)
| 5108 | |
| 5109 | // BuildInfo returns build information for this instance of Coder. |
| 5110 | func (c *Client) BuildInfo(ctx context.Context) (BuildInfoResponse, error) { |
| 5111 | res, err := c.Request(ctx, http.MethodGet, "/api/v2/buildinfo", nil) |
| 5112 | if err != nil { |
| 5113 | return BuildInfoResponse{}, err |
| 5114 | } |
| 5115 | defer res.Body.Close() |
| 5116 | |
| 5117 | if res.StatusCode != http.StatusOK || ExpectJSONMime(res) != nil { |
| 5118 | return BuildInfoResponse{}, ReadBodyAsError(res) |
| 5119 | } |
| 5120 | |
| 5121 | var buildInfo BuildInfoResponse |
| 5122 | return buildInfo, json.NewDecoder(res.Body).Decode(&buildInfo) |
| 5123 | } |
| 5124 | |
| 5125 | type Experiment string |
| 5126 |