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

     1  package txnoffsetcommit
     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  	GroupID         string         `kafka:"min=v0,max=v2|min=v3,max=v3,compact"`
    16  	ProducerID      int64          `kafka:"min=v0,max=v3"`
    17  	ProducerEpoch   int16          `kafka:"min=v0,max=v3"`
    18  	GenerationID    int32          `kafka:"min=v3,max=v3"`
    19  	MemberID        string         `kafka:"min=v3,max=v3,compact"`
    20  	GroupInstanceID string         `kafka:"min=v3,max=v3,compact,nullable"`
    21  	Topics          []RequestTopic `kafka:"min=v0,max=v3"`
    22  }
    23  
    24  type RequestTopic struct {
    25  	// We need at least one tagged field to indicate that this is a "flexible" message
    26  	// type.
    27  	_ struct{} `kafka:"min=v3,max=v3,tag"`
    28  
    29  	Name       string             `kafka:"min=v0,max=v2|min=v3,max=v3,compact"`
    30  	Partitions []RequestPartition `kafka:"min=v0,max=v3"`
    31  }
    32  
    33  type RequestPartition struct {
    34  	// We need at least one tagged field to indicate that this is a "flexible" message
    35  	// type.
    36  	_ struct{} `kafka:"min=v3,max=v3,tag"`
    37  
    38  	Partition            int32  `kafka:"min=v0,max=v3"`
    39  	CommittedOffset      int64  `kafka:"min=v0,max=v3"`
    40  	CommittedLeaderEpoch int32  `kafka:"min=v2,max=v3"`
    41  	CommittedMetadata    string `kafka:"min=v0,max=v2|min=v3,max=v3,nullable,compact"`
    42  }
    43  
    44  func (r *Request) ApiKey() protocol.ApiKey { return protocol.TxnOffsetCommit }
    45  
    46  func (r *Request) Group() string { return r.GroupID }
    47  
    48  var _ protocol.GroupMessage = (*Request)(nil)
    49  
    50  type Response struct {
    51  	// We need at least one tagged field to indicate that this is a "flexible" message
    52  	// type.
    53  	_ struct{} `kafka:"min=v3,max=v3,tag"`
    54  
    55  	ThrottleTimeMs int32           `kafka:"min=v0,max=v3"`
    56  	Topics         []ResponseTopic `kafka:"min=v0,max=v3"`
    57  }
    58  
    59  type ResponseTopic struct {
    60  	// We need at least one tagged field to indicate that this is a "flexible" message
    61  	// type.
    62  	_ struct{} `kafka:"min=v3,max=v3,tag"`
    63  
    64  	Name       string              `kafka:"min=v0,max=v2|min=v3,max=v3,compact"`
    65  	Partitions []ResponsePartition `kafka:"min=v0,max=v3"`
    66  }
    67  
    68  type ResponsePartition struct {
    69  	// We need at least one tagged field to indicate that this is a "flexible" message
    70  	// type.
    71  	_ struct{} `kafka:"min=v3,max=v3,tag"`
    72  
    73  	Partition int32 `kafka:"min=v0,max=v3"`
    74  	ErrorCode int16 `kafka:"min=v0,max=v3"`
    75  }
    76  
    77  func (r *Response) ApiKey() protocol.ApiKey { return protocol.TxnOffsetCommit }