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

Method ClusterClient

tests/framework/integration/cluster.go:1460–1476  ·  view source on GitHub ↗
(t testing.TB, opts ...framecfg.ClientOption)

Source from the content-addressed store, hash-verified

1458}
1459
1460func (c *Cluster) ClusterClient(t testing.TB, opts ...framecfg.ClientOption) (client *clientv3.Client, err error) {
1461 cfg, err := c.newClientCfg()
1462 if err != nil {
1463 return nil, err
1464 }
1465 for _, opt := range opts {
1466 opt(cfg)
1467 }
1468 client, err = newClientV3(*cfg)
1469 if err != nil {
1470 return nil, err
1471 }
1472 t.Cleanup(func() {
1473 client.Close()
1474 })
1475 return client, nil
1476}
1477
1478func WithAuth(userName, password string) framecfg.ClientOption {
1479 return func(c any) {

Callers 10

TestCompactionHashFunction · 0.95
testLeaseStressFunction · 0.95
TestPeriodicCheckFunction · 0.95
TestCompactHashCheckFunction · 0.95
TestCompactionHashFunction · 0.95
waitMembersForLeaderMethod · 0.95
ClientMethod · 0.80

Calls 4

newClientCfgMethod · 0.95
newClientV3Function · 0.70
CleanupMethod · 0.65
CloseMethod · 0.65

Tested by 8

TestCompactionHashFunction · 0.76
testLeaseStressFunction · 0.76
TestPeriodicCheckFunction · 0.76
TestCompactHashCheckFunction · 0.76
TestCompactionHashFunction · 0.76