offsetdelete.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package offsetdelete
  2. import "github.com/segmentio/kafka-go/protocol"
  3. func init() {
  4. protocol.Register(&Request{}, &Response{})
  5. }
  6. type Request struct {
  7. GroupID string `kafka:"min=v0,max=v0"`
  8. Topics []RequestTopic `kafka:"min=v0,max=v0"`
  9. }
  10. func (r *Request) ApiKey() protocol.ApiKey { return protocol.OffsetDelete }
  11. func (r *Request) Group() string { return r.GroupID }
  12. type RequestTopic struct {
  13. Name string `kafka:"min=v0,max=v0"`
  14. Partitions []RequestPartition `kafka:"min=v0,max=v0"`
  15. }
  16. type RequestPartition struct {
  17. PartitionIndex int32 `kafka:"min=v0,max=v0"`
  18. }
  19. var (
  20. _ protocol.GroupMessage = (*Request)(nil)
  21. )
  22. type Response struct {
  23. ErrorCode int16 `kafka:"min=v0,max=v0"`
  24. ThrottleTimeMs int32 `kafka:"min=v0,max=v0"`
  25. Topics []ResponseTopic `kafka:"min=v0,max=v0"`
  26. }
  27. func (r *Response) ApiKey() protocol.ApiKey { return protocol.OffsetDelete }
  28. type ResponseTopic struct {
  29. Name string `kafka:"min=v0,max=v0"`
  30. Partitions []ResponsePartition `kafka:"min=v0,max=v0"`
  31. }
  32. type ResponsePartition struct {
  33. PartitionIndex int32 `kafka:"min=v0,max=v0"`
  34. ErrorCode int16 `kafka:"min=v0,max=v0"`
  35. }