github.com/QuangHoangHao/kafka-go@v0.4.36/protocol/apiversions/apiversions.go (about)

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