heartbeat_response.go 536 B

1234567891011121314151617181920212223242526272829303132
  1. package sarama
  2. type HeartbeatResponse struct {
  3. Err KError
  4. }
  5. func (r *HeartbeatResponse) encode(pe packetEncoder) error {
  6. pe.putInt16(int16(r.Err))
  7. return nil
  8. }
  9. func (r *HeartbeatResponse) decode(pd packetDecoder, version int16) error {
  10. kerr, err := pd.getInt16()
  11. if err != nil {
  12. return err
  13. }
  14. r.Err = KError(kerr)
  15. return nil
  16. }
  17. func (r *HeartbeatResponse) key() int16 {
  18. return 12
  19. }
  20. func (r *HeartbeatResponse) version() int16 {
  21. return 0
  22. }
  23. func (r *HeartbeatResponse) requiredVersion() KafkaVersion {
  24. return V0_9_0_0
  25. }