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

Function NewClientV3

tests/framework/integration/cluster.go:900–925  ·  view source on GitHub ↗

NewClientV3 creates a new grpc client connection to the member

(m *Member)

Source from the content-addressed store, hash-verified

898
899// NewClientV3 creates a new grpc client connection to the member
900func NewClientV3(m *Member) (*clientv3.Client, error) {
901 if m.GRPCURL == "" {
902 return nil, fmt.Errorf("member not configured for grpc")
903 }
904
905 cfg := clientv3.Config{
906 Endpoints: []string{m.GRPCURL},
907 DialTimeout: 5 * time.Second,
908 DialOptions: []grpc.DialOption{grpc.WithBlock()},
909 MaxCallSendMsgSize: m.ClientMaxCallSendMsgSize,
910 MaxCallRecvMsgSize: m.ClientMaxCallRecvMsgSize,
911 Logger: m.Logger.Named("client"),
912 }
913
914 if m.ClientTLSInfo != nil {
915 tls, err := m.ClientTLSInfo.ClientConfig()
916 if err != nil {
917 return nil, err
918 }
919 cfg.TLS = tls
920 }
921 if m.DialOptions != nil {
922 cfg.DialOptions = append(cfg.DialOptions, m.DialOptions...)
923 }
924 return newClientV3(cfg)
925}
926
927// Clone returns a member with the same server configuration. The returned
928// member will not set PeerListeners and ClientListeners.

Callers 2

LaunchMethod · 0.85
NewClientV3Method · 0.85

Calls 3

ClientConfigMethod · 0.80
newClientV3Function · 0.70
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…