github.com/hoveychen/kafka-go@v0.4.42/protocol/offsetcommit/offsetcommit.go (about)

     1  package offsetcommit
     2  
     3  import "github.com/hoveychen/kafka-go/protocol"
     4  
     5  func init() {
     6  	protocol.Register(&Request{}, &Response{})
     7  }
     8  
     9  type Request struct {
    10  	GroupID         string         `kafka:"min=v0,max=v7"`
    11  	GenerationID    int32          `kafka:"min=v1,max=v7"`
    12  	MemberID        string         `kafka:"min=v1,max=v7"`
    13  	RetentionTimeMs int64          `kafka:"min=v2,max=v4"`
    14  	GroupInstanceID string         `kafka:"min=v7,max=v7,nullable"`
    15  	Topics          []RequestTopic `kafka:"min=v0,max=v7"`
    16  }
    17  
    18  func (r *Request) ApiKey() protocol.ApiKey { return protocol.OffsetCommit }
    19  
    20  func (r *Request) Group() string { return r.GroupID }
    21  
    22  type RequestTopic struct {
    23  	Name       string             `kafka:"min=v0,max=v7"`
    24  	Partitions []RequestPartition `kafka:"min=v0,max=v7"`
    25  }
    26  
    27  type RequestPartition struct {
    28  	PartitionIndex       int32  `kafka:"min=v0,max=v7"`
    29  	CommittedOffset      int64  `kafka:"min=v0,max=v7"`
    30  	CommitTimestamp      int64  `kafka:"min=v1,max=v1"`
    31  	CommittedLeaderEpoch int32  `kafka:"min=v5,max=v7"`
    32  	CommittedMetadata    string `kafka:"min=v0,max=v7,nullable"`
    33  }
    34  
    35  var (
    36  	_ protocol.GroupMessage = (*Request)(nil)
    37  )
    38  
    39  type Response struct {
    40  	ThrottleTimeMs int32           `kafka:"min=v3,max=v7"`
    41  	Topics         []ResponseTopic `kafka:"min=v0,max=v7"`
    42  }
    43  
    44  func (r *Response) ApiKey() protocol.ApiKey { return protocol.OffsetCommit }
    45  
    46  type ResponseTopic struct {
    47  	Name       string              `kafka:"min=v0,max=v7"`
    48  	Partitions []ResponsePartition `kafka:"min=v0,max=v7"`
    49  }
    50  
    51  type ResponsePartition struct {
    52  	PartitionIndex int32 `kafka:"min=v0,max=v7"`
    53  	ErrorCode      int16 `kafka:"min=v0,max=v7"`
    54  }