You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
830 B
47 lines
830 B
package sarama
|
|
|
|
type HeartbeatRequest struct {
|
|
GroupId string
|
|
GenerationId int32
|
|
MemberId string
|
|
}
|
|
|
|
func (r *HeartbeatRequest) encode(pe packetEncoder) error {
|
|
if err := pe.putString(r.GroupId); err != nil {
|
|
return err
|
|
}
|
|
|
|
pe.putInt32(r.GenerationId)
|
|
|
|
if err := pe.putString(r.MemberId); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (r *HeartbeatRequest) decode(pd packetDecoder, version int16) (err error) {
|
|
if r.GroupId, err = pd.getString(); err != nil {
|
|
return
|
|
}
|
|
if r.GenerationId, err = pd.getInt32(); err != nil {
|
|
return
|
|
}
|
|
if r.MemberId, err = pd.getString(); err != nil {
|
|
return
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (r *HeartbeatRequest) key() int16 {
|
|
return 12
|
|
}
|
|
|
|
func (r *HeartbeatRequest) version() int16 {
|
|
return 0
|
|
}
|
|
|
|
func (r *HeartbeatRequest) requiredVersion() KafkaVersion {
|
|
return V0_9_0_0
|
|
}
|
|
|