acl_describe_request.go 793 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package sarama
  2. //DescribeAclsRequest is a secribe 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) requiredVersion() KafkaVersion {
  26. switch d.Version {
  27. case 1:
  28. return V2_0_0_0
  29. default:
  30. return V0_11_0_0
  31. }
  32. }