blob: ef290d4bc6da35ea014325834bee01d3e9cfde22 [file] [log] [blame]
William Kurkianea869482019-04-09 15:16:11 -04001package sarama
2
3type SaslHandshakeResponse struct {
4 Err KError
5 EnabledMechanisms []string
6}
7
8func (r *SaslHandshakeResponse) encode(pe packetEncoder) error {
9 pe.putInt16(int16(r.Err))
10 return pe.putStringArray(r.EnabledMechanisms)
11}
12
13func (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
28func (r *SaslHandshakeResponse) key() int16 {
29 return 17
30}
31
32func (r *SaslHandshakeResponse) version() int16 {
33 return 0
34}
35
36func (r *SaslHandshakeResponse) requiredVersion() KafkaVersion {
37 return V0_10_0_0
38}