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

Struct Conn

conn.go:25–68  ·  view source on GitHub ↗

Conn represents a connection to a kafka broker. Instances of Conn are safe to use concurrently from multiple goroutines.

Source from the content-addressed store, hash-verified

23//
24// Instances of Conn are safe to use concurrently from multiple goroutines.
25type Conn struct {
26 // base network connection
27 conn net.Conn
28
29 // number of inflight requests on the connection.
30 inflight int32
31
32 // offset management (synchronized on the mutex field)
33 mutex sync.Mutex
34 offset int64
35
36 // read buffer (synchronized on rlock)
37 rlock sync.Mutex
38 rbuf bufio.Reader
39
40 // write buffer (synchronized on wlock)
41 wlock sync.Mutex
42 wbuf bufio.Writer
43 wb writeBuffer
44
45 // deadline management
46 wdeadline connDeadline
47 rdeadline connDeadline
48
49 // immutable values of the connection object
50 clientID string
51 topic string
52 partition int32
53 fetchMaxBytes int32
54 fetchMinSize int32
55 broker int32
56 rack string
57
58 // correlation ID generator (synchronized on wlock)
59 correlationID int32
60
61 // number of replica acks required when publishing to a partition
62 requiredAcks int32
63
64 // lazily loaded API versions used by this connection
65 apiVersions atomic.Value // apiVersionMap
66
67 transactionalID *string
68}
69
70type apiVersionMap map[apiKey]ApiVersion
71

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected