mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
client: s/v2Prefix/DefaultV2KeysPrefix/
This commit is contained in:
parent
d7301a5cf4
commit
ebe32689d4
@ -31,7 +31,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
v2Prefix = "/v2/keys"
|
DefaultV2KeysPrefix = "/v2/keys"
|
||||||
ErrTimeout = context.DeadlineExceeded
|
ErrTimeout = context.DeadlineExceeded
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ func NewHTTPClient(tr *http.Transport, ep string, timeout time.Duration) (*httpC
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *httpClient) SetPrefix(p string) {
|
func (c *httpClient) SetPrefix(p string) {
|
||||||
v2Prefix = p
|
DefaultV2KeysPrefix = p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *httpClient) Create(key, val string, ttl time.Duration) (*Response, error) {
|
func (c *httpClient) Create(key, val string, ttl time.Duration) (*Response, error) {
|
||||||
@ -193,7 +193,7 @@ func (hw *httpWatcher) Next() (*Response, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func v2URL(ep url.URL, key string) *url.URL {
|
func v2URL(ep url.URL, key string) *url.URL {
|
||||||
ep.Path = path.Join(ep.Path, v2Prefix, key)
|
ep.Path = path.Join(ep.Path, DefaultV2KeysPrefix, key)
|
||||||
return &ep
|
return &ep
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user