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,8 +31,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
v2Prefix = "/v2/keys"
|
||||
ErrTimeout = context.DeadlineExceeded
|
||||
DefaultV2KeysPrefix = "/v2/keys"
|
||||
ErrTimeout = context.DeadlineExceeded
|
||||
)
|
||||
|
||||
// transport mimics http.Transport to provide an interface which can be
|
||||
@ -65,7 +65,7 @@ func NewHTTPClient(tr *http.Transport, ep string, timeout time.Duration) (*httpC
|
||||
}
|
||||
|
||||
func (c *httpClient) SetPrefix(p string) {
|
||||
v2Prefix = p
|
||||
DefaultV2KeysPrefix = p
|
||||
}
|
||||
|
||||
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 {
|
||||
ep.Path = path.Join(ep.Path, v2Prefix, key)
|
||||
ep.Path = path.Join(ep.Path, DefaultV2KeysPrefix, key)
|
||||
return &ep
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user