leave_group_request.go 711 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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) requiredVersion() KafkaVersion {
  31. return V0_9_0_0
  32. }