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