deletetopics.go 837 B

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