describe_groups_request.go 613 B

123456789101112131415161718192021222324252627282930
  1. package sarama
  2. type DescribeGroupsRequest struct {
  3. Groups []string
  4. }
  5. func (r *DescribeGroupsRequest) encode(pe packetEncoder) error {
  6. return pe.putStringArray(r.Groups)
  7. }
  8. func (r *DescribeGroupsRequest) decode(pd packetDecoder, version int16) (err error) {
  9. r.Groups, err = pd.getStringArray()
  10. return
  11. }
  12. func (r *DescribeGroupsRequest) key() int16 {
  13. return 15
  14. }
  15. func (r *DescribeGroupsRequest) version() int16 {
  16. return 0
  17. }
  18. func (r *DescribeGroupsRequest) requiredVersion() KafkaVersion {
  19. return V0_9_0_0
  20. }
  21. func (r *DescribeGroupsRequest) AddGroup(group string) {
  22. r.Groups = append(r.Groups, group)
  23. }