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

Function saslAuthenticateRoundTrip

transport.go:1349–1361  ·  view source on GitHub ↗

saslAuthenticate sends the SASL authenticate message. This function must be immediately preceded by a successful saslHandshake. See http://kafka.apache.org/protocol.html#The_Messages_SaslAuthenticate

(pc *protocol.Conn, data []byte)

Source from the content-addressed store, hash-verified

1347//
1348// See http://kafka.apache.org/protocol.html#The_Messages_SaslAuthenticate
1349func saslAuthenticateRoundTrip(pc *protocol.Conn, data []byte) ([]byte, error) {
1350 msg, err := pc.RoundTrip(&saslauthenticate.Request{
1351 AuthBytes: data,
1352 })
1353 if err != nil {
1354 return nil, err
1355 }
1356 res := msg.(*saslauthenticate.Response)
1357 if res.ErrorCode != 0 {
1358 err = makeError(res.ErrorCode, res.ErrorMessage)
1359 }
1360 return res.AuthBytes, err
1361}
1362
1363var _ RoundTripper = (*Transport)(nil)

Callers 1

authenticateSASLFunction · 0.85

Calls 2

makeErrorFunction · 0.85
RoundTripMethod · 0.65

Tested by

no test coverage detected