Scott Baker | 2d89798 | 2019-09-24 11:50:08 -0700 | [diff] [blame^] | 1 | package sarama |
| 2 | |
| 3 | type SaslHandshakeRequest struct { |
| 4 | Mechanism string |
| 5 | Version int16 |
| 6 | } |
| 7 | |
| 8 | func (r *SaslHandshakeRequest) encode(pe packetEncoder) error { |
| 9 | if err := pe.putString(r.Mechanism); err != nil { |
| 10 | return err |
| 11 | } |
| 12 | |
| 13 | return nil |
| 14 | } |
| 15 | |
| 16 | func (r *SaslHandshakeRequest) decode(pd packetDecoder, version int16) (err error) { |
| 17 | if r.Mechanism, err = pd.getString(); err != nil { |
| 18 | return err |
| 19 | } |
| 20 | |
| 21 | return nil |
| 22 | } |
| 23 | |
| 24 | func (r *SaslHandshakeRequest) key() int16 { |
| 25 | return 17 |
| 26 | } |
| 27 | |
| 28 | func (r *SaslHandshakeRequest) version() int16 { |
| 29 | return r.Version |
| 30 | } |
| 31 | |
| 32 | func (r *SaslHandshakeRequest) requiredVersion() KafkaVersion { |
| 33 | return V0_10_0_0 |
| 34 | } |