Scott Baker | e7144bc | 2019-10-01 14:16:47 -0700 | [diff] [blame^] | 1 | package sarama |
| 2 | |
| 3 | //ConsumerMetadataRequest is used for metadata requests |
| 4 | type ConsumerMetadataRequest struct { |
| 5 | ConsumerGroup string |
| 6 | } |
| 7 | |
| 8 | func (r *ConsumerMetadataRequest) encode(pe packetEncoder) error { |
| 9 | tmp := new(FindCoordinatorRequest) |
| 10 | tmp.CoordinatorKey = r.ConsumerGroup |
| 11 | tmp.CoordinatorType = CoordinatorGroup |
| 12 | return tmp.encode(pe) |
| 13 | } |
| 14 | |
| 15 | func (r *ConsumerMetadataRequest) decode(pd packetDecoder, version int16) (err error) { |
| 16 | tmp := new(FindCoordinatorRequest) |
| 17 | if err := tmp.decode(pd, version); err != nil { |
| 18 | return err |
| 19 | } |
| 20 | r.ConsumerGroup = tmp.CoordinatorKey |
| 21 | return nil |
| 22 | } |
| 23 | |
| 24 | func (r *ConsumerMetadataRequest) key() int16 { |
| 25 | return 10 |
| 26 | } |
| 27 | |
| 28 | func (r *ConsumerMetadataRequest) version() int16 { |
| 29 | return 0 |
| 30 | } |
| 31 | |
| 32 | func (r *ConsumerMetadataRequest) requiredVersion() KafkaVersion { |
| 33 | return V0_8_2_0 |
| 34 | } |