mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
client: s/v2URL/v2KeysURL/
This commit is contained in:
parent
ebe32689d4
commit
a85a47c8f9
@ -192,7 +192,7 @@ func (hw *httpWatcher) Next() (*Response, error) {
|
|||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func v2URL(ep url.URL, key string) *url.URL {
|
func v2KeysURL(ep url.URL, key string) *url.URL {
|
||||||
ep.Path = path.Join(ep.Path, DefaultV2KeysPrefix, key)
|
ep.Path = path.Join(ep.Path, DefaultV2KeysPrefix, key)
|
||||||
return &ep
|
return &ep
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@ type getAction struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g *getAction) httpRequest(ep url.URL) *http.Request {
|
func (g *getAction) httpRequest(ep url.URL) *http.Request {
|
||||||
u := v2URL(ep, g.Key)
|
u := v2KeysURL(ep, g.Key)
|
||||||
|
|
||||||
params := u.Query()
|
params := u.Query()
|
||||||
params.Set("recursive", strconv.FormatBool(g.Recursive))
|
params.Set("recursive", strconv.FormatBool(g.Recursive))
|
||||||
@ -224,7 +224,7 @@ type waitAction struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *waitAction) httpRequest(ep url.URL) *http.Request {
|
func (w *waitAction) httpRequest(ep url.URL) *http.Request {
|
||||||
u := v2URL(ep, w.Key)
|
u := v2KeysURL(ep, w.Key)
|
||||||
|
|
||||||
params := u.Query()
|
params := u.Query()
|
||||||
params.Set("wait", "true")
|
params.Set("wait", "true")
|
||||||
@ -243,7 +243,7 @@ type createAction struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *createAction) httpRequest(ep url.URL) *http.Request {
|
func (c *createAction) httpRequest(ep url.URL) *http.Request {
|
||||||
u := v2URL(ep, c.Key)
|
u := v2KeysURL(ep, c.Key)
|
||||||
|
|
||||||
params := u.Query()
|
params := u.Query()
|
||||||
params.Set("prevExist", "false")
|
params.Set("prevExist", "false")
|
||||||
|
@ -73,7 +73,7 @@ func TestV2URLHelper(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for i, tt := range tests {
|
for i, tt := range tests {
|
||||||
got := v2URL(tt.endpoint, tt.key)
|
got := v2KeysURL(tt.endpoint, tt.key)
|
||||||
if tt.want != *got {
|
if tt.want != *got {
|
||||||
t.Errorf("#%d: want=%#v, got=%#v", i, tt.want, *got)
|
t.Errorf("#%d: want=%#v, got=%#v", i, tt.want, *got)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user