Currently the vast majority of client.Client functions return http.Reponse, which is pretty unhelpful for the most part, and requires a lot of fiddling with response bodies etc on the user end
// Reset shuts down deployment and deletes the contents of the deployment's
// project directory
func (c *Client) Reset() (*http.Response, error) {
return c.post("/reset", nil)
}
We should update these so that they handle http responses internally (and return errors if needed) and instead of returning the raw responses, return some more predictable stuff. Client.Reset(), for example, could just be:
func (c *Client) Reset() error {
/* handle http.Response and do stuff */
}
Theres a bit of code repetition in the client that we can probably improve on as well
This is not a particularly trivial PR, and might require a few passes.
Currently the vast majority of client.Client functions return
http.Reponse, which is pretty unhelpful for the most part, and requires a lot of fiddling with response bodies etc on the user endWe should update these so that they handle http responses internally (and return errors if needed) and instead of returning the raw responses, return some more predictable stuff.
Client.Reset(), for example, could just be:Theres a bit of code repetition in the client that we can probably improve on as well
This is not a particularly trivial PR, and might require a few passes.