leavegroup.go 884 B

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