forked from segmentio/kafka-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
leavegroup.go
39 lines (30 loc) · 884 Bytes
/
leavegroup.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package kafka
import "bufio"
type leaveGroupRequestV0 struct {
// GroupID holds the unique group identifier
GroupID string
// MemberID assigned by the group coordinator or the zero string if joining
// for the first time.
MemberID string
}
func (t leaveGroupRequestV0) size() int32 {
return sizeofString(t.GroupID) + sizeofString(t.MemberID)
}
func (t leaveGroupRequestV0) writeTo(wb *writeBuffer) {
wb.writeString(t.GroupID)
wb.writeString(t.MemberID)
}
type leaveGroupResponseV0 struct {
// ErrorCode holds response error code
ErrorCode int16
}
func (t leaveGroupResponseV0) size() int32 {
return sizeofInt16(t.ErrorCode)
}
func (t leaveGroupResponseV0) writeTo(wb *writeBuffer) {
wb.writeInt16(t.ErrorCode)
}
func (t *leaveGroupResponseV0) readFrom(r *bufio.Reader, size int) (remain int, err error) {
remain, err = readInt16(r, size, &t.ErrorCode)
return
}