acl_delete_request.go 859 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package sarama
  2. type DeleteAclsRequest struct {
  3. Filters []*AclFilter
  4. }
  5. func (d *DeleteAclsRequest) encode(pe packetEncoder) error {
  6. if err := pe.putArrayLength(len(d.Filters)); err != nil {
  7. return err
  8. }
  9. for _, filter := range d.Filters {
  10. if err := filter.encode(pe); err != nil {
  11. return err
  12. }
  13. }
  14. return nil
  15. }
  16. func (d *DeleteAclsRequest) decode(pd packetDecoder, version int16) (err error) {
  17. n, err := pd.getArrayLength()
  18. if err != nil {
  19. return err
  20. }
  21. d.Filters = make([]*AclFilter, n)
  22. for i := 0; i < n; i++ {
  23. d.Filters[i] = new(AclFilter)
  24. if err := d.Filters[i].decode(pd, version); err != nil {
  25. return err
  26. }
  27. }
  28. return nil
  29. }
  30. func (d *DeleteAclsRequest) key() int16 {
  31. return 31
  32. }
  33. func (d *DeleteAclsRequest) version() int16 {
  34. return 0
  35. }
  36. func (d *DeleteAclsRequest) requiredVersion() KafkaVersion {
  37. return V0_11_0_0
  38. }