sasl_handshake_request.go 593 B

123456789101112131415161718192021222324252627282930313233
  1. package sarama
  2. type SaslHandshakeRequest struct {
  3. Mechanism string
  4. }
  5. func (r *SaslHandshakeRequest) encode(pe packetEncoder) error {
  6. if err := pe.putString(r.Mechanism); err != nil {
  7. return err
  8. }
  9. return nil
  10. }
  11. func (r *SaslHandshakeRequest) decode(pd packetDecoder, version int16) (err error) {
  12. if r.Mechanism, err = pd.getString(); err != nil {
  13. return err
  14. }
  15. return nil
  16. }
  17. func (r *SaslHandshakeRequest) key() int16 {
  18. return 17
  19. }
  20. func (r *SaslHandshakeRequest) version() int16 {
  21. return 0
  22. }
  23. func (r *SaslHandshakeRequest) requiredVersion() KafkaVersion {
  24. return V0_10_0_0
  25. }