MCPcopy
hub / github.com/etcd-io/etcd / newClientV3

Function newClientV3

tests/framework/integration/cluster_proxy.go:109–129  ·  view source on GitHub ↗
(cfg clientv3.Config)

Source from the content-addressed store, hash-verified

107}
108
109func 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}

Callers 2

NewClientV3Function · 0.70
ClusterClientMethod · 0.70

Calls 4

ToGRPCFunction · 0.70
LockMethod · 0.65
CloseMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…