William Kurkian | ea86948 | 2019-04-09 15:16:11 -0400 | [diff] [blame] | 1 | package sarama |
| 2 | |
| 3 | type SaslHandshakeResponse struct { |
| 4 | Err KError |
| 5 | EnabledMechanisms []string |
| 6 | } |
| 7 | |
| 8 | func (r *SaslHandshakeResponse) encode(pe packetEncoder) error { |
| 9 | pe.putInt16(int16(r.Err)) |
| 10 | return pe.putStringArray(r.EnabledMechanisms) |
| 11 | } |
| 12 | |
| 13 | func (r *SaslHandshakeResponse) decode(pd packetDecoder, version int16) error { |
| 14 | kerr, err := pd.getInt16() |
| 15 | if err != nil { |
| 16 | return err |
| 17 | } |
| 18 | |
| 19 | r.Err = KError(kerr) |
| 20 | |
| 21 | if r.EnabledMechanisms, err = pd.getStringArray(); err != nil { |
| 22 | return err |
| 23 | } |
| 24 | |
| 25 | return nil |
| 26 | } |
| 27 | |
| 28 | func (r *SaslHandshakeResponse) key() int16 { |
| 29 | return 17 |
| 30 | } |
| 31 | |
| 32 | func (r *SaslHandshakeResponse) version() int16 { |
| 33 | return 0 |
| 34 | } |
| 35 | |
| 36 | func (r *SaslHandshakeResponse) requiredVersion() KafkaVersion { |
| 37 | return V0_10_0_0 |
| 38 | } |