瀏覽代碼

clientv3: keep NewFromURL the same, add method NewFromURLs

jiaxuanzhou 8 年之前
父節點
當前提交
ad448fb280
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      clientv3/client.go

+ 6 - 1
clientv3/client.go

@@ -90,7 +90,12 @@ func NewCtxClient(ctx context.Context) *Client {
 }
 }
 
 
 // NewFromURL creates a new etcdv3 client from a URL.
 // 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})
 	return New(Config{Endpoints: urls})
 }
 }