github.com/streamdal/segmentio-kafka-go@v0.4.47-streamdal/protocol/deleteacls/deleteacls.go (about)

     1  package deleteacls
     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  	Filters []RequestFilter `kafka:"min=v0,max=v3"`
    15  }
    16  
    17  func (r *Request) ApiKey() protocol.ApiKey { return protocol.DeleteAcls }
    18  
    19  func (r *Request) Broker(cluster protocol.Cluster) (protocol.Broker, error) {
    20  	return cluster.Brokers[cluster.Controller], nil
    21  }
    22  
    23  type RequestFilter 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  	FilterResults  []FilterResult `kafka:"min=v0,max=v3"`
    44  }
    45  
    46  func (r *Response) ApiKey() protocol.ApiKey { return protocol.DeleteAcls }
    47  
    48  type FilterResult struct {
    49  	// We need at least one tagged field to indicate that v2+ uses "flexible"
    50  	// messages.
    51  	_ struct{} `kafka:"min=v2,max=v3,tag"`
    52  
    53  	ErrorCode    int16         `kafka:"min=v0,max=v3"`
    54  	ErrorMessage string        `kafka:"min=v0,max=v1,nullable|min=v2,max=v3,nullable,compact"`
    55  	MatchingACLs []MatchingACL `kafka:"min=v0,max=v3"`
    56  }
    57  
    58  type MatchingACL struct {
    59  	// We need at least one tagged field to indicate that v2+ uses "flexible"
    60  	// messages.
    61  	_ struct{} `kafka:"min=v2,max=v3,tag"`
    62  
    63  	ErrorCode           int16  `kafka:"min=v0,max=v3"`
    64  	ErrorMessage        string `kafka:"min=v0,max=v1,nullable|min=v2,max=v3,nullable,compact"`
    65  	ResourceType        int8   `kafka:"min=v0,max=v3"`
    66  	ResourceName        string `kafka:"min=v0,max=v1|min=v2,max=v3,compact"`
    67  	ResourcePatternType int8   `kafka:"min=v1,max=v3"`
    68  	Principal           string `kafka:"min=v0,max=v1|min=v2,max=v3,compact"`
    69  	Host                string `kafka:"min=v0,max=v1|min=v2,max=v3,compact"`
    70  	Operation           int8   `kafka:"min=v0,max=v3"`
    71  	PermissionType      int8   `kafka:"min=v0,max=v3"`
    72  }
    73  
    74  var _ protocol.BrokerMessage = (*Request)(nil)