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

Method RoundTrip

protocol/conn.go:81–95  ·  view source on GitHub ↗
(msg Message)

Source from the content-addressed store, hash-verified

79}
80
81func (c *Conn) RoundTrip(msg Message) (Message, error) {
82 correlationID := atomic.AddInt32(&c.idgen, +1)
83 versions, _ := c.versions.Load().(map[ApiKey]int16)
84 apiVersion := versions[msg.ApiKey()]
85
86 if p, _ := msg.(PreparedMessage); p != nil {
87 p.Prepare(apiVersion)
88 }
89
90 if raw, ok := msg.(RawExchanger); ok && raw.Required(versions) {
91 return raw.RawExchange(c)
92 }
93
94 return RoundTrip(c, apiVersion, correlationID, c.clientID, msg)
95}
96
97var (
98 _ net.Conn = (*Conn)(nil)

Callers 1

connectMethod · 0.95

Calls 5

RoundTripFunction · 0.85
ApiKeyMethod · 0.65
PrepareMethod · 0.65
RequiredMethod · 0.65
RawExchangeMethod · 0.65

Tested by

no test coverage detected