acl_describe_request.go 726 B

1234567891011121314151617181920212223242526272829303132333435
  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) requiredVersion() KafkaVersion {
  23. switch d.Version {
  24. case 1:
  25. return V2_0_0_0
  26. default:
  27. return V0_11_0_0
  28. }
  29. }