Browse Source

client: unexport httpAction

Brian Waldon 11 years ago
parent
commit
2aecbaf165
2 changed files with 8 additions and 8 deletions
  1. 6 6
      client/http.go
  2. 2 2
      client/http_test.go

+ 6 - 6
client/http.go

@@ -66,12 +66,12 @@ type SyncableHTTPClient interface {
 }
 }
 
 
 type HTTPClient 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 httpClientFactory func(CancelableTransport, url.URL) HTTPClient
 
 
-type HTTPAction interface {
+type httpAction interface {
 	HTTPRequest(url.URL) *http.Request
 	HTTPRequest(url.URL) *http.Request
 }
 }
 
 
@@ -110,7 +110,7 @@ func (c *httpClusterClient) reset(tr CancelableTransport, eps []string) error {
 	return nil
 	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()
 	c.RLock()
 	leps := len(c.endpoints)
 	leps := len(c.endpoints)
 	eps := make([]url.URL, leps)
 	eps := make([]url.URL, leps)
@@ -186,7 +186,7 @@ type simpleHTTPClient struct {
 	endpoint  url.URL
 	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)
 	req := act.HTTPRequest(c.endpoint)
 
 
 	rtchan := make(chan roundTripResponse, 1)
 	rtchan := make(chan roundTripResponse, 1)
@@ -230,7 +230,7 @@ type redirectFollowingHTTPClient struct {
 	max    int
 	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++ {
 	for i := 0; i <= r.max; i++ {
 		resp, body, err := r.client.Do(ctx, act)
 		resp, body, err := r.client.Do(ctx, act)
 		if err != nil {
 		if err != nil {
@@ -257,7 +257,7 @@ func (r *redirectFollowingHTTPClient) Do(ctx context.Context, act HTTPAction) (*
 }
 }
 
 
 type redirectedHTTPAction struct {
 type redirectedHTTPAction struct {
-	action   HTTPAction
+	action   httpAction
 	location url.URL
 	location url.URL
 }
 }
 
 

+ 2 - 2
client/http_test.go

@@ -32,7 +32,7 @@ type staticHTTPClient struct {
 	err  error
 	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
 	return &s.resp, nil, s.err
 }
 }
 
 
@@ -54,7 +54,7 @@ type multiStaticHTTPClient struct {
 	cur       int
 	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]
 	r := s.responses[s.cur]
 	s.cur++
 	s.cur++
 	return &r.resp, nil, r.err
 	return &r.resp, nil, r.err