delete_groups_request.go 666 B

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