mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
client: introduce httpActionDo interface
This commit is contained in:
parent
9d07db4432
commit
323fb1ec85
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ type MembersAPI interface {
|
||||
}
|
||||
|
||||
type httpMembersAPI struct {
|
||||
client *httpClient
|
||||
client httpActionDo
|
||||
timeout time.Duration
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user