Skip to content

Commit

Permalink
feat(client): expose a requester interface
Browse files Browse the repository at this point in the history
  • Loading branch information
flotter committed Sep 21, 2023
1 parent b1da4dd commit b44cdf9
Show file tree
Hide file tree
Showing 13 changed files with 449 additions and 371 deletions.
8 changes: 4 additions & 4 deletions client/changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ type changeAndData struct {
// Change fetches information about a Change given its ID.
func (client *Client) Change(id string) (*Change, error) {
var chgd changeAndData
_, err := client.doSync("GET", "/v1/changes/"+id, nil, nil, nil, &chgd)
err := client.doSync("GET", "/v1/changes/"+id, nil, nil, nil, &chgd)
if err != nil {
return nil, err
}
Expand All @@ -111,7 +111,7 @@ func (client *Client) Abort(id string) (*Change, error) {
}

var chg Change
if _, err := client.doSync("POST", "/v1/changes/"+id, nil, nil, &body, &chg); err != nil {
if err := client.doSync("POST", "/v1/changes/"+id, nil, nil, &body, &chg); err != nil {
return nil, err
}

Expand Down Expand Up @@ -158,7 +158,7 @@ func (client *Client) Changes(opts *ChangesOptions) ([]*Change, error) {
}

var chgds []changeAndData
_, err := client.doSync("GET", "/v1/changes", query, nil, nil, &chgds)
err := client.doSync("GET", "/v1/changes", query, nil, nil, &chgds)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -190,7 +190,7 @@ func (client *Client) WaitChange(id string, opts *WaitChangeOptions) (*Change, e
query.Set("timeout", opts.Timeout.String())
}

_, err := client.doSync("GET", "/v1/changes/"+id+"/wait", query, nil, nil, &chgd)
err := client.doSync("GET", "/v1/changes/"+id+"/wait", query, nil, nil, &chgd)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion client/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (client *Client) Checks(opts *ChecksOptions) ([]*CheckInfo, error) {
query["names"] = opts.Names
}
var checks []*CheckInfo
_, err := client.doSync("GET", "/v1/checks", query, nil, nil, &checks)
err := client.doSync("GET", "/v1/checks", query, nil, nil, &checks)
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit b44cdf9

Please sign in to comment.