From 2aecbaf165c3dd10df26099fbe9dad722c5d0ed7 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Mon, 26 Jan 2015 17:11:22 -0800 Subject: [PATCH] client: unexport httpAction --- client/http.go | 12 ++++++------ client/http_test.go | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/http.go b/client/http.go index 987cbfce8..72f835b44 100644 --- a/client/http.go +++ b/client/http.go @@ -66,12 +66,12 @@ type SyncableHTTPClient interface { } type HTTPClient interface { - Do(context.Context, HTTPAction) (*http.Response, []byte, error) + Do(context.Context, httpAction) (*http.Response, []byte, error) } type httpClientFactory func(CancelableTransport, url.URL) HTTPClient -type HTTPAction interface { +type httpAction interface { HTTPRequest(url.URL) *http.Request } @@ -110,7 +110,7 @@ func (c *httpClusterClient) reset(tr CancelableTransport, eps []string) error { return nil } -func (c *httpClusterClient) Do(ctx context.Context, act HTTPAction) (resp *http.Response, body []byte, err error) { +func (c *httpClusterClient) Do(ctx context.Context, act httpAction) (resp *http.Response, body []byte, err error) { c.RLock() leps := len(c.endpoints) eps := make([]url.URL, leps) @@ -186,7 +186,7 @@ type simpleHTTPClient struct { endpoint url.URL } -func (c *simpleHTTPClient) Do(ctx context.Context, act HTTPAction) (*http.Response, []byte, error) { +func (c *simpleHTTPClient) Do(ctx context.Context, act httpAction) (*http.Response, []byte, error) { req := act.HTTPRequest(c.endpoint) rtchan := make(chan roundTripResponse, 1) @@ -230,7 +230,7 @@ type redirectFollowingHTTPClient struct { max int } -func (r *redirectFollowingHTTPClient) Do(ctx context.Context, act HTTPAction) (*http.Response, []byte, error) { +func (r *redirectFollowingHTTPClient) Do(ctx context.Context, act httpAction) (*http.Response, []byte, error) { for i := 0; i <= r.max; i++ { resp, body, err := r.client.Do(ctx, act) if err != nil { @@ -257,7 +257,7 @@ func (r *redirectFollowingHTTPClient) Do(ctx context.Context, act HTTPAction) (* } type redirectedHTTPAction struct { - action HTTPAction + action httpAction location url.URL } diff --git a/client/http_test.go b/client/http_test.go index 19dd8e89c..0c29c6aa5 100644 --- a/client/http_test.go +++ b/client/http_test.go @@ -32,7 +32,7 @@ type staticHTTPClient struct { err error } -func (s *staticHTTPClient) Do(context.Context, HTTPAction) (*http.Response, []byte, error) { +func (s *staticHTTPClient) Do(context.Context, httpAction) (*http.Response, []byte, error) { return &s.resp, nil, s.err } @@ -54,7 +54,7 @@ type multiStaticHTTPClient struct { cur int } -func (s *multiStaticHTTPClient) Do(context.Context, HTTPAction) (*http.Response, []byte, error) { +func (s *multiStaticHTTPClient) Do(context.Context, httpAction) (*http.Response, []byte, error) { r := s.responses[s.cur] s.cur++ return &r.resp, nil, r.err