initproducerid.go 1018 B

123456789101112131415161718192021222324252627282930313233
  1. package initproducerid
  2. import "github.com/segmentio/kafka-go/protocol"
  3. func init() {
  4. protocol.Register(&Request{}, &Response{})
  5. }
  6. type Request struct {
  7. // We need at least one tagged field to indicate that this is a "flexible" message
  8. // type.
  9. _ struct{} `kafka:"min=v2,max=v4,tag"`
  10. TransactionalID string `kafka:"min=v0,max=v4,nullable"`
  11. TransactionTimeoutMs int32 `kafka:"min=v0,max=v4"`
  12. ProducerID int64 `kafka:"min=v3,max=v4"`
  13. ProducerEpoch int16 `kafka:"min=v3,max=v4"`
  14. }
  15. func (r *Request) ApiKey() protocol.ApiKey { return protocol.InitProducerId }
  16. type Response struct {
  17. // We need at least one tagged field to indicate that this is a "flexible" message
  18. // type.
  19. _ struct{} `kafka:"min=v2,max=v4,tag"`
  20. ThrottleTimeMs int32 `kafka:"min=v0,max=v4"`
  21. ErrorCode int16 `kafka:"min=v0,max=v4"`
  22. ProducerID int64 `kafka:"min=v0,max=v4"`
  23. ProducerEpoch int16 `kafka:"min=v0,max=v4"`
  24. }
  25. func (r *Response) ApiKey() protocol.ApiKey { return protocol.InitProducerId }