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

Method roundTrip

client.go:102–116  ·  view source on GitHub ↗
(ctx context.Context, addr net.Addr, msg protocol.Message)

Source from the content-addressed store, hash-verified

100}
101
102func (c *Client) roundTrip(ctx context.Context, addr net.Addr, msg protocol.Message) (protocol.Message, error) {
103 if c.Timeout > 0 {
104 var cancel context.CancelFunc
105 ctx, cancel = context.WithTimeout(ctx, c.Timeout)
106 defer cancel()
107 }
108
109 if addr == nil {
110 if addr = c.Addr; addr == nil {
111 return nil, errors.New("no address was given for the kafka cluster in the request or on the client")
112 }
113 }
114
115 return c.transport().RoundTrip(ctx, addr, msg)
116}
117
118func (c *Client) transport() RoundTripper {
119 if c.Transport != nil {

Callers 15

HeartbeatMethod · 0.95
LeaveGroupMethod · 0.95
OffsetDeleteMethod · 0.95
CreatePartitionsMethod · 0.95
CreateACLsMethod · 0.95
AlterClientQuotasMethod · 0.95
AddOffsetsToTxnMethod · 0.95
ListGroupsMethod · 0.95
DescribeGroupsMethod · 0.95
RawProduceMethod · 0.95
ElectLeadersMethod · 0.95
DeleteTopicsMethod · 0.95

Calls 2

transportMethod · 0.95
RoundTripMethod · 0.65

Tested by

no test coverage detected