github.com/segmentio/kafka-go@v0.4.48-0.20240318174348-3f6244eb34fd/protocol/syncgroup/syncgroup.go (about) 1 package syncgroup 2 3 import "github.com/segmentio/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=v4,max=v5,tag"` 13 14 GroupID string `kafka:"min=v0,max=v3|min=v4,max=v5,compact"` 15 GenerationID int32 `kafka:"min=v0,max=v5|min=v4,max=v5,compact"` 16 MemberID string `kafka:"min=v0,max=v3|min=v4,max=v5,compact"` 17 GroupInstanceID string `kafka:"min=v3,max=v3,nullable|min=v4,max=v5,nullable,compact"` 18 ProtocolType string `kafka:"min=v5,max=v5"` 19 ProtocolName string `kafka:"min=v5,max=v5"` 20 Assignments []RequestAssignment `kafka:"min=v0,max=v5"` 21 } 22 23 type RequestAssignment struct { 24 // We need at least one tagged field to indicate that this is a "flexible" message 25 // type. 26 _ struct{} `kafka:"min=v4,max=v5,tag"` 27 28 MemberID string `kafka:"min=v0,max=v3|min=v4,max=v5,compact"` 29 Assignment []byte `kafka:"min=v0,max=v3|min=v4,max=v5,compact"` 30 } 31 32 func (r *Request) ApiKey() protocol.ApiKey { return protocol.SyncGroup } 33 34 func (r *Request) Group() string { return r.GroupID } 35 36 var _ protocol.GroupMessage = (*Request)(nil) 37 38 type Response struct { 39 // We need at least one tagged field to indicate that this is a "flexible" message 40 // type. 41 _ struct{} `kafka:"min=v4,max=v5,tag"` 42 43 ThrottleTimeMS int32 `kafka:"min=v1,max=v5"` 44 ErrorCode int16 `kafka:"min=v0,max=v5"` 45 ProtocolType string `kafka:"min=v5,max=v5"` 46 ProtocolName string `kafka:"min=v5,max=v5"` 47 Assignments []byte `kafka:"min=v0,max=v3|min=v4,max=v5,compact"` 48 } 49 50 func (r *Response) ApiKey() protocol.ApiKey { return protocol.SyncGroup }