apiversions.go 699 B

123456789101112131415161718192021222324252627
  1. package apiversions
  2. import "github.com/segmentio/kafka-go/protocol"
  3. func init() {
  4. protocol.Register(&Request{}, &Response{})
  5. }
  6. type Request struct {
  7. _ struct{} `kafka:"min=v0,max=v2"`
  8. }
  9. func (r *Request) ApiKey() protocol.ApiKey { return protocol.ApiVersions }
  10. type Response struct {
  11. ErrorCode int16 `kafka:"min=v0,max=v2"`
  12. ApiKeys []ApiKeyResponse `kafka:"min=v0,max=v2"`
  13. ThrottleTimeMs int32 `kafka:"min=v1,max=v2"`
  14. }
  15. func (r *Response) ApiKey() protocol.ApiKey { return protocol.ApiVersions }
  16. type ApiKeyResponse struct {
  17. ApiKey int16 `kafka:"min=v0,max=v2"`
  18. MinVersion int16 `kafka:"min=v0,max=v2"`
  19. MaxVersion int16 `kafka:"min=v0,max=v2"`
  20. }