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