فهرست منبع

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.
-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})
 }