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

Function newClient

topics/list_topics_test.go:100–117  ·  view source on GitHub ↗
(addr net.Addr)

Source from the content-addressed store, hash-verified

98}
99
100func newClient(addr net.Addr) (*kafka.Client, func()) {
101 conns := &ktesting.ConnWaitGroup{
102 DialFunc: (&net.Dialer{}).DialContext,
103 }
104
105 transport := &kafka.Transport{
106 Dial: conns.Dial,
107 Resolver: kafka.NewBrokerResolver(nil),
108 }
109
110 client := &kafka.Client{
111 Addr: addr,
112 Timeout: 5 * time.Second,
113 Transport: transport,
114 }
115
116 return client, func() { transport.CloseIdleConnections(); conns.Wait() }
117}

Callers 1

newLocalClientFunction · 0.70

Calls 1

CloseIdleConnectionsMethod · 0.95

Tested by

no test coverage detected