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

Function NewConn

protocol/conn.go:19–25  ·  view source on GitHub ↗
(conn net.Conn, clientID string)

Source from the content-addressed store, hash-verified

17}
18
19func NewConn(conn net.Conn, clientID string) *Conn {
20 return &Conn{
21 buffer: bufio.NewReader(conn),
22 conn: conn,
23 clientID: clientID,
24 }
25}
26
27func (c *Conn) String() string {
28 return fmt.Sprintf("kafka://%s@%s->%s", c.clientID, c.LocalAddr(), c.RemoteAddr())

Callers 1

connectMethod · 0.92

Calls 1

NewReaderMethod · 0.65

Tested by

no test coverage detected