clientv3: keep NewFromURL the same, add method NewFromURLs

release-3.4
jiaxuanzhou 2018-03-27 10:28:28 +08:00
parent e1bf612ee8
commit ad448fb280
1 changed files with 6 additions and 1 deletions

View File

@ -90,7 +90,12 @@ func NewCtxClient(ctx context.Context) *Client {
}
// NewFromURL creates a new etcdv3 client from a URL.
func NewFromURL(urls []string) (*Client, error) {
func NewFromURL(url string) (*Client, error) {
return New(Config{Endpoints: []string{url}})
}
// NewFromURLs creates a new etcdv3 client from URLs.
func NewFromURLs(urls []string) (*Client, error) {
return New(Config{Endpoints: urls})
}