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

Function saslHandshakeRoundTrip

transport.go:1331–1343  ·  view source on GitHub ↗

saslHandshake sends the SASL handshake message. This will determine whether the Mechanism is supported by the cluster. If it's not, this function will error out with UnsupportedSASLMechanism. If the mechanism is unsupported, the handshake request will reply with the list of the cluster's configur

(pc *protocol.Conn, mechanism string)

Source from the content-addressed store, hash-verified

1329//
1330// See http://kafka.apache.org/protocol.html#The_Messages_SaslHandshake
1331func saslHandshakeRoundTrip(pc *protocol.Conn, mechanism string) error {
1332 msg, err := pc.RoundTrip(&saslhandshake.Request{
1333 Mechanism: mechanism,
1334 })
1335 if err != nil {
1336 return err
1337 }
1338 res := msg.(*saslhandshake.Response)
1339 if res.ErrorCode != 0 {
1340 err = Error(res.ErrorCode)
1341 }
1342 return err
1343}
1344
1345// saslAuthenticate sends the SASL authenticate message. This function must
1346// be immediately preceded by a successful saslHandshake.

Callers 1

authenticateSASLFunction · 0.85

Calls 2

ErrorTypeAlias · 0.70
RoundTripMethod · 0.65

Tested by

no test coverage detected