github.com/segmentio/kafka-go@v0.4.48-0.20240318174348-3f6244eb34fd/protocol/describeacls/describeacls.go (about) 1 package describeacls 2 3 import "github.com/segmentio/kafka-go/protocol" 4 5 func init() { 6 protocol.Register(&Request{}, &Response{}) 7 } 8 9 type Request struct { 10 // We need at least one tagged field to indicate that v2+ uses "flexible" 11 // messages. 12 _ struct{} `kafka:"min=v2,max=v3,tag"` 13 14 Filter ACLFilter `kafka:"min=v0,max=v3"` 15 } 16 17 func (r *Request) ApiKey() protocol.ApiKey { return protocol.DescribeAcls } 18 19 func (r *Request) Broker(cluster protocol.Cluster) (protocol.Broker, error) { 20 return cluster.Brokers[cluster.Controller], nil 21 } 22 23 type ACLFilter struct { 24 // We need at least one tagged field to indicate that v2+ uses "flexible" 25 // messages. 26 _ struct{} `kafka:"min=v2,max=v3,tag"` 27 28 ResourceTypeFilter int8 `kafka:"min=v0,max=v3"` 29 ResourceNameFilter string `kafka:"min=v0,max=v1,nullable|min=v2,max=v3,nullable,compact"` 30 ResourcePatternTypeFilter int8 `kafka:"min=v1,max=v3"` 31 PrincipalFilter string `kafka:"min=v0,max=v1,nullable|min=v2,max=v3,nullable,compact"` 32 HostFilter string `kafka:"min=v0,max=v1,nullable|min=v2,max=v3,nullable,compact"` 33 Operation int8 `kafka:"min=v0,max=v3"` 34 PermissionType int8 `kafka:"min=v0,max=v3"` 35 } 36 37 type Response struct { 38 // We need at least one tagged field to indicate that v2+ uses "flexible" 39 // messages. 40 _ struct{} `kafka:"min=v2,max=v3,tag"` 41 42 ThrottleTimeMs int32 `kafka:"min=v0,max=v3"` 43 ErrorCode int16 `kafka:"min=v0,max=v3"` 44 ErrorMessage string `kafka:"min=v0,max=v1,nullable|min=v2,max=v3,nullable,compact"` 45 Resources []Resource `kafka:"min=v0,max=v3"` 46 } 47 48 func (r *Response) ApiKey() protocol.ApiKey { return protocol.DescribeAcls } 49 50 type Resource struct { 51 // We need at least one tagged field to indicate that v2+ uses "flexible" 52 // messages. 53 _ struct{} `kafka:"min=v2,max=v3,tag"` 54 55 ResourceType int8 `kafka:"min=v0,max=v3"` 56 ResourceName string `kafka:"min=v0,max=v1|min=v2,max=v3,compact"` 57 PatternType int8 `kafka:"min=v1,max=v3"` 58 ACLs []ResponseACL `kafka:"min=v0,max=v3"` 59 } 60 61 type ResponseACL struct { 62 // We need at least one tagged field to indicate that v2+ uses "flexible" 63 // messages. 64 _ struct{} `kafka:"min=v2,max=v3,tag"` 65 66 Principal string `kafka:"min=v0,max=v1|min=v2,max=v3,compact"` 67 Host string `kafka:"min=v0,max=v1|min=v2,max=v3,compact"` 68 Operation int8 `kafka:"min=v0,max=v3"` 69 PermissionType int8 `kafka:"min=v0,max=v3"` 70 } 71 72 var _ protocol.BrokerMessage = (*Request)(nil)