MCPcopy
hub / github.com/segmentio/kafka-go / newClient

Function newClient

client_test.go:86–103  ·  view source on GitHub ↗
(addr net.Addr)

Source from the content-addressed store, hash-verified

84}
85
86func newClient(addr net.Addr) (*Client, func()) {
87 conns := &ktesting.ConnWaitGroup{
88 DialFunc: (&net.Dialer{}).DialContext,
89 }
90
91 transport := &Transport{
92 Dial: conns.Dial,
93 Resolver: NewBrokerResolver(nil),
94 }
95
96 client := &Client{
97 Addr: addr,
98 Timeout: 5 * time.Second,
99 Transport: transport,
100 }
101
102 return client, func() { transport.CloseIdleConnections(); conns.Wait() }
103}
104
105func TestClient(t *testing.T) {
106 tests := []struct {

Callers 3

TestClientInitProducerIdFunction · 0.70
newLocalClientFunction · 0.70

Calls 2

CloseIdleConnectionsMethod · 0.95
NewBrokerResolverFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…