github.com/rbisecke/kafka-go@v0.4.27/protocol/endtxn/endtxn.go (about)

     1  package endtxn
     2  
     3  import "github.com/rbisecke/kafka-go/protocol"
     4  
     5  func init() {
     6  	protocol.Register(&Request{}, &Response{})
     7  }
     8  
     9  type Request struct {
    10  	// We need at least one tagged field to indicate that this is a "flexible" message
    11  	// type.
    12  	_ struct{} `kafka:"min=v3,max=v3,tag"`
    13  
    14  	TransactionalID string `kafka:"min=v0,max=v2|min=v3,max=v3,compact"`
    15  	ProducerID      int64  `kafka:"min=v0,max=v3"`
    16  	ProducerEpoch   int16  `kafka:"min=v0,max=v3"`
    17  	Committed       bool   `kafka:"min=v0,max=v3"`
    18  }
    19  
    20  func (r *Request) ApiKey() protocol.ApiKey { return protocol.EndTxn }
    21  
    22  func (r *Request) Transaction() string { return r.TransactionalID }
    23  
    24  var _ protocol.TransactionalMessage = (*Request)(nil)
    25  
    26  type Response struct {
    27  	// We need at least one tagged field to indicate that this is a "flexible" message
    28  	// type.
    29  	_ struct{} `kafka:"min=v3,max=v3,tag"`
    30  
    31  	ThrottleTimeMs int32 `kafka:"min=v0,max=v3"`
    32  	ErrorCode      int16 `kafka:"min=v0,max=v3"`
    33  }
    34  
    35  func (r *Response) ApiKey() protocol.ApiKey { return protocol.EndTxn }