consumer_metadata_request.go 741 B

123456789101112131415161718192021222324252627282930313233
  1. package sarama
  2. type ConsumerMetadataRequest struct {
  3. ConsumerGroup string
  4. }
  5. func (r *ConsumerMetadataRequest) encode(pe packetEncoder) error {
  6. tmp := new(FindCoordinatorRequest)
  7. tmp.CoordinatorKey = r.ConsumerGroup
  8. tmp.CoordinatorType = CoordinatorGroup
  9. return tmp.encode(pe)
  10. }
  11. func (r *ConsumerMetadataRequest) decode(pd packetDecoder, version int16) (err error) {
  12. tmp := new(FindCoordinatorRequest)
  13. if err := tmp.decode(pd, version); err != nil {
  14. return err
  15. }
  16. r.ConsumerGroup = tmp.CoordinatorKey
  17. return nil
  18. }
  19. func (r *ConsumerMetadataRequest) key() int16 {
  20. return 10
  21. }
  22. func (r *ConsumerMetadataRequest) version() int16 {
  23. return 0
  24. }
  25. func (r *ConsumerMetadataRequest) requiredVersion() KafkaVersion {
  26. return V0_8_2_0
  27. }