acl_describe_request.go 893 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package sarama
  2. // DescribeAclsRequest is a describe acl request type
  3. type DescribeAclsRequest struct {
  4. Version int
  5. AclFilter
  6. }
  7. func (d *DescribeAclsRequest) encode(pe packetEncoder) error {
  8. d.AclFilter.Version = d.Version
  9. return d.AclFilter.encode(pe)
  10. }
  11. func (d *DescribeAclsRequest) decode(pd packetDecoder, version int16) (err error) {
  12. d.Version = int(version)
  13. d.AclFilter.Version = int(version)
  14. return d.AclFilter.decode(pd, version)
  15. }
  16. func (d *DescribeAclsRequest) key() int16 {
  17. return 29
  18. }
  19. func (d *DescribeAclsRequest) version() int16 {
  20. return int16(d.Version)
  21. }
  22. func (d *DescribeAclsRequest) headerVersion() int16 {
  23. return 1
  24. }
  25. func (d *DescribeAclsRequest) isValidVersion() bool {
  26. return d.Version >= 0 && d.Version <= 1
  27. }
  28. func (d *DescribeAclsRequest) requiredVersion() KafkaVersion {
  29. switch d.Version {
  30. case 1:
  31. return V2_0_0_0
  32. default:
  33. return V0_11_0_0
  34. }
  35. }