blob: 3ef57b5afad02a83fe9f31182e1e944bdf446159 [file] [log] [blame]
William Kurkianea869482019-04-09 15:16:11 -04001package sarama
2
3type SaslAuthenticateResponse struct {
4 Err KError
5 ErrorMessage *string
6 SaslAuthBytes []byte
7}
8
9func (r *SaslAuthenticateResponse) encode(pe packetEncoder) error {
10 pe.putInt16(int16(r.Err))
11 if err := pe.putNullableString(r.ErrorMessage); err != nil {
12 return err
13 }
14 return pe.putBytes(r.SaslAuthBytes)
15}
16
17func (r *SaslAuthenticateResponse) decode(pd packetDecoder, version int16) error {
18 kerr, err := pd.getInt16()
19 if err != nil {
20 return err
21 }
22
23 r.Err = KError(kerr)
24
25 if r.ErrorMessage, err = pd.getNullableString(); err != nil {
26 return err
27 }
28
29 r.SaslAuthBytes, err = pd.getBytes()
30
31 return err
32}
33
34func (r *SaslAuthenticateResponse) key() int16 {
35 return APIKeySASLAuth
36}
37
38func (r *SaslAuthenticateResponse) version() int16 {
39 return 0
40}
41
khenaidoo106c61a2021-08-11 18:05:46 -040042func (r *SaslAuthenticateResponse) headerVersion() int16 {
43 return 0
44}
45
William Kurkianea869482019-04-09 15:16:11 -040046func (r *SaslAuthenticateResponse) requiredVersion() KafkaVersion {
47 return V1_0_0_0
48}