github.com/hack0072008/kafka-go@v1.0.1/protocol/deletetopics/deletetopics.go (about)

     1  package deletetopics
     2  
     3  import "github.com/hack0072008/kafka-go/protocol"
     4  
     5  func init() {
     6  	protocol.Register(&Request{}, &Response{})
     7  }
     8  
     9  type Request struct {
    10  	TopicNames []string `kafka:"min=v0,max=v3"`
    11  	TimeoutMs  int32    `kafka:"min=v0,max=v3"`
    12  }
    13  
    14  func (r *Request) ApiKey() protocol.ApiKey { return protocol.DeleteTopics }
    15  
    16  func (r *Request) Broker(cluster protocol.Cluster) (protocol.Broker, error) {
    17  	return cluster.Brokers[cluster.Controller], nil
    18  }
    19  
    20  type Response struct {
    21  	ThrottleTimeMs int32           `kafka:"min=v1,max=v3"`
    22  	Responses      []ResponseTopic `kafka:"min=v0,max=v3"`
    23  }
    24  
    25  func (r *Response) ApiKey() protocol.ApiKey { return protocol.DeleteTopics }
    26  
    27  type ResponseTopic struct {
    28  	Name      string `kafka:"min=v0,max=v3"`
    29  	ErrorCode int16  `kafka:"min=v0,max=v3"`
    30  }
    31  
    32  var (
    33  	_ protocol.BrokerMessage = (*Request)(nil)
    34  )