Skip to content

Commit

Permalink
Change Raw to Request
Browse files Browse the repository at this point in the history
  • Loading branch information
samcoe committed May 17, 2022
1 parent 9be15a7 commit 5871b7f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/api/rest_client.go
Expand Up @@ -23,7 +23,7 @@ func NewRESTClient(host string, opts *api.ClientOptions) api.RESTClient {
}
}

func (c restClient) Raw(method string, path string, body io.Reader) (*http.Response, error) {
func (c restClient) Request(method string, path string, body io.Reader) (*http.Response, error) {
url := restURL(c.host, path)
req, err := http.NewRequest(method, url, body)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/api/rest_client_test.go
Expand Up @@ -11,7 +11,7 @@ import (
"gopkg.in/h2non/gock.v1"
)

func TestRESTClientRaw(t *testing.T) {
func TestRESTClientRequest(t *testing.T) {
tests := []struct {
name string
host string
Expand Down Expand Up @@ -104,7 +104,7 @@ func TestRESTClientRaw(t *testing.T) {
tt.httpMocks()
}
client := NewRESTClient(tt.host, nil)
resp, err := client.Raw("GET", tt.path, nil)
resp, err := client.Request("GET", tt.path, nil)
t.Cleanup(func() { resp.Body.Close() })
body, readErr := io.ReadAll(resp.Body)
assert.NoError(t, readErr)
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/client.go
Expand Up @@ -84,11 +84,11 @@ type RESTClient interface {
// The response is populated into the response argument.
Put(path string, body io.Reader, response interface{}) error

// Raw issues a request with type specified by method to the
// Request issues a request with type specified by method to the
// specified path with the specified body.
// The response is returned rather than being populated
// into a response argument.
Raw(method string, path string, body io.Reader) (*http.Response, error)
Request(method string, path string, body io.Reader) (*http.Response, error)
}

// GQLClient is the interface that wraps methods for the different types of
Expand Down

0 comments on commit 5871b7f

Please sign in to comment.