(cfg clientv3.Config)
| 107 | } |
| 108 | |
| 109 | func newClientV3(cfg clientv3.Config) (*clientv3.Client, error) { |
| 110 | c, err := clientv3.New(cfg) |
| 111 | if err != nil { |
| 112 | return nil, err |
| 113 | } |
| 114 | rpc := ToGRPC(c) |
| 115 | c.KV = clientv3.NewKVFromKVClient(rpc.KV, c) |
| 116 | pmu.Lock() |
| 117 | lc := c.Lease |
| 118 | c.Lease = clientv3.NewLeaseFromLeaseClient(rpc.Lease, c, cfg.DialTimeout) |
| 119 | c.Watcher = &proxyCloser{ |
| 120 | Watcher: clientv3.NewWatchFromWatchClient(rpc.Watch, c), |
| 121 | wdonec: proxies[c].wdonec, |
| 122 | kvdonec: proxies[c].kvdonec, |
| 123 | lclose: func() { lc.Close() }, |
| 124 | lpdonec: proxies[c].lpdonec, |
| 125 | proxyCtxCancel: proxies[c].ctxCancel, |
| 126 | } |
| 127 | pmu.Unlock() |
| 128 | return c, nil |
| 129 | } |
no test coverage detected
searching dependent graphs…