sasl_handshake_request.go 686 B

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