leave_group_request.go 776 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package sarama
  2. type LeaveGroupRequest struct {
  3. GroupId string
  4. MemberId string
  5. }
  6. func (r *LeaveGroupRequest) encode(pe packetEncoder) error {
  7. if err := pe.putString(r.GroupId); err != nil {
  8. return err
  9. }
  10. if err := pe.putString(r.MemberId); err != nil {
  11. return err
  12. }
  13. return nil
  14. }
  15. func (r *LeaveGroupRequest) decode(pd packetDecoder, version int16) (err error) {
  16. if r.GroupId, err = pd.getString(); err != nil {
  17. return
  18. }
  19. if r.MemberId, err = pd.getString(); err != nil {
  20. return
  21. }
  22. return nil
  23. }
  24. func (r *LeaveGroupRequest) key() int16 {
  25. return 13
  26. }
  27. func (r *LeaveGroupRequest) version() int16 {
  28. return 0
  29. }
  30. func (r *LeaveGroupRequest) headerVersion() int16 {
  31. return 1
  32. }
  33. func (r *LeaveGroupRequest) requiredVersion() KafkaVersion {
  34. return V0_9_0_0
  35. }