client: introduce httpActionDo interface

This commit is contained in:
Brian Waldon 2014-10-30 17:04:06 -07:00
parent 9d07db4432
commit 323fb1ec85
3 changed files with 7 additions and 3 deletions

View File

@ -42,6 +42,10 @@ type httpAction interface {
httpRequest(url.URL) *http.Request
}
type httpActionDo interface {
do(context.Context, httpAction) (int, []byte, error)
}
type roundTripResponse struct {
resp *http.Response
err error

View File

@ -100,7 +100,7 @@ func (n *Node) String() string {
}
type httpKeysAPI struct {
client *httpClient
client httpActionDo
prefix string
timeout time.Duration
}
@ -168,7 +168,7 @@ func (k *httpKeysAPI) RecursiveWatch(key string, idx uint64) Watcher {
}
type httpWatcher struct {
client *httpClient
client httpActionDo
nextWait waitAction
}

View File

@ -60,7 +60,7 @@ type MembersAPI interface {
}
type httpMembersAPI struct {
client *httpClient
client httpActionDo
timeout time.Duration
}