github.com/hack0072008/kafka-go@v1.0.1/leavegroup.go (about) 1 package kafka 2 3 import "bufio" 4 5 type leaveGroupRequestV0 struct { 6 // GroupID holds the unique group identifier 7 GroupID string 8 9 // MemberID assigned by the group coordinator or the zero string if joining 10 // for the first time. 11 MemberID string 12 } 13 14 func (t leaveGroupRequestV0) size() int32 { 15 return sizeofString(t.GroupID) + sizeofString(t.MemberID) 16 } 17 18 func (t leaveGroupRequestV0) writeTo(wb *writeBuffer) { 19 wb.writeString(t.GroupID) 20 wb.writeString(t.MemberID) 21 } 22 23 type leaveGroupResponseV0 struct { 24 // ErrorCode holds response error code 25 ErrorCode int16 26 } 27 28 func (t leaveGroupResponseV0) size() int32 { 29 return sizeofInt16(t.ErrorCode) 30 } 31 32 func (t leaveGroupResponseV0) writeTo(wb *writeBuffer) { 33 wb.writeInt16(t.ErrorCode) 34 } 35 36 func (t *leaveGroupResponseV0) readFrom(r *bufio.Reader, size int) (remain int, err error) { 37 remain, err = readInt16(r, size, &t.ErrorCode) 38 return 39 }