func (t *OffsetCommitRequestV0) Unmarshal(r *wipro.Reader) { t.ConsumerGroupID = r.ReadString() t.OffsetCommitInTopicV0s = make([]OffsetCommitInTopicV0, int(r.ReadInt32())) for i := range t.OffsetCommitInTopicV0s { t.OffsetCommitInTopicV0s[i].Unmarshal(r) } }
func (t *ErrorInTopic) Unmarshal(r *wipro.Reader) { t.TopicName = r.ReadString() t.ErrorInPartitions = make([]ErrorInPartition, int(r.ReadInt32())) for i := range t.ErrorInPartitions { t.ErrorInPartitions[i].Unmarshal(r) } }
func (t *OffsetCommitInTopicV2) Unmarshal(r *wipro.Reader) { t.TopicName = r.ReadString() t.OffsetCommitInPartitionV2s = make([]OffsetCommitInPartitionV2, int(r.ReadInt32())) for i := range t.OffsetCommitInPartitionV2s { t.OffsetCommitInPartitionV2s[i].Unmarshal(r) } }
func (t *OffsetFetchRequestV1) Unmarshal(r *wipro.Reader) { t.ConsumerGroup = r.ReadString() t.PartitionInTopics = make([]PartitionInTopic, int(r.ReadInt32())) for i := range t.PartitionInTopics { t.PartitionInTopics[i].Unmarshal(r) } }
func (t *PartitionAssignment) Unmarshal(r *wipro.Reader) { t.Topic = r.ReadString() t.Partitions = make([]int32, int(r.ReadInt32())) for i := range t.Partitions { t.Partitions[i] = r.ReadInt32() } }
func (t *FetchMessageSetInTopic) Unmarshal(r *wipro.Reader) { t.TopicName = r.ReadString() t.FetchMessageSetInPartitions = make([]FetchMessageSetInPartition, int(r.ReadInt32())) for i := range t.FetchMessageSetInPartitions { t.FetchMessageSetInPartitions[i].Unmarshal(r) } }
func (t *JoinGroupRequest) Unmarshal(r *wipro.Reader) { t.GroupID = r.ReadString() t.SessionTimeout = r.ReadInt32() t.MemberID = r.ReadString() t.ProtocolType = r.ReadString() t.GroupProtocols.Unmarshal(r) }
func (t *OffsetRequest) Unmarshal(r *wipro.Reader) { t.ReplicaID = r.ReadInt32() t.TimeInTopics = make([]TimeInTopic, int(r.ReadInt32())) for i := range t.TimeInTopics { t.TimeInTopics[i].Unmarshal(r) } }
func (t *OffsetMetadataInTopic) Unmarshal(r *wipro.Reader) { t.TopicName = r.ReadString() t.OffsetMetadataInPartitions = make([]OffsetMetadataInPartition, int(r.ReadInt32())) for i := range t.OffsetMetadataInPartitions { t.OffsetMetadataInPartitions[i].Unmarshal(r) } }
func (t *Request) Unmarshal(r *wipro.Reader) { t.APIKey = r.ReadInt16() t.APIVersion = r.ReadInt16() t.CorrelationID = r.ReadInt32() t.ClientID = r.ReadString() t.RequestMessage.Unmarshal(r) }
func (t *RequestOrResponse) Unmarshal(r *wipro.Reader) { t.Size = r.ReadInt32() start := r.Offset t.M.Unmarshal(r) if r.Err == nil && int(t.Size) != r.Offset-start { r.Err = ErrSizeMismatch } }
func (t *TopicMetadata) Unmarshal(r *wipro.Reader) { t.ErrorCode.Unmarshal(r) t.TopicName = r.ReadString() t.PartitionMetadatas = make([]PartitionMetadata, int(r.ReadInt32())) for i := range t.PartitionMetadatas { t.PartitionMetadatas[i].Unmarshal(r) } }
func (t *OffsetsInPartition) Unmarshal(r *wipro.Reader) { t.Partition = r.ReadInt32() t.ErrorCode.Unmarshal(r) t.Offsets = make([]int64, int(r.ReadInt32())) for i := range t.Offsets { t.Offsets[i] = r.ReadInt64() } }
func (t *ProduceRequest) Unmarshal(r *wipro.Reader) { t.RequiredAcks = r.ReadInt16() t.Timeout = r.ReadInt32() t.MessageSetInTopics = make([]MessageSetInTopic, int(r.ReadInt32())) for i := range t.MessageSetInTopics { t.MessageSetInTopics[i].Unmarshal(r) } }
func (t *SizedMessage) Unmarshal(r *wipro.Reader) { t.Size = r.ReadInt32() start := r.Offset t.CRCMessage.Unmarshal(r) if r.Err == nil && int(t.Size) != r.Offset-start { r.Err = ErrSizeMismatch } }
func (t *JoinGroupResponse) Unmarshal(r *wipro.Reader) { t.ErrorCode.Unmarshal(r) t.GenerationID = r.ReadInt32() t.GroupProtocolName = r.ReadString() t.LeaderID = r.ReadString() t.MemberID = r.ReadString() t.MemberWithMetas.Unmarshal(r) }
func (t *OffsetCommitRequestV2) Unmarshal(r *wipro.Reader) { t.ConsumerGroup = r.ReadString() t.ConsumerGroupGenerationID = r.ReadInt32() t.ConsumerID = r.ReadString() t.RetentionTime = r.ReadInt64() t.OffsetCommitInTopicV2s = make([]OffsetCommitInTopicV2, int(r.ReadInt32())) for i := range t.OffsetCommitInTopicV2s { t.OffsetCommitInTopicV2s[i].Unmarshal(r) } }
func (t *TopicMetadataResponse) Unmarshal(r *wipro.Reader) { t.Brokers = make([]Broker, int(r.ReadInt32())) for i := range t.Brokers { t.Brokers[i].Unmarshal(r) } t.TopicMetadatas = make([]TopicMetadata, int(r.ReadInt32())) for i := range t.TopicMetadatas { t.TopicMetadatas[i].Unmarshal(r) } }
func (t *MessageSet) Unmarshal(r *wipro.Reader) { size := int(r.ReadInt32()) start := r.Offset for r.Offset-start < size { var m OffsetMessage m.Unmarshal(r) if r.Err != nil { r.Err = nil r.Offset = len(r.B) return } *t = append(*t, m) } }
func (t *FetchRequest) Unmarshal(r *wipro.Reader) { t.ReplicaID = r.ReadInt32() t.MaxWaitTime = r.ReadInt32() t.MinBytes = r.ReadInt32() t.FetchOffsetInTopics = make([]FetchOffsetInTopic, int(r.ReadInt32())) for i := range t.FetchOffsetInTopics { t.FetchOffsetInTopics[i].Unmarshal(r) } }
func TestUnmarshal(t *testing.T) { t.Parallel() r := wipro.Reader{ B: []byte{0x0, 0x0, 0x1, 0x7a, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x4, 0x74, 0x65, 0x73, 0x74, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x1, 0x56, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2d, 0x9, 0xf8, 0xf8, 0x91, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,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 0x31, 0x38, 0x3a, 0x35, 0x30, 0x2b, 0x30, 0x38, 0x3a, 0x30, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x2d, 0x41, 0x18, 0xf6, 0xf5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x32, 0x30, 0x31, 0x35, 0x2d, 0x30, 0x39, 0x2d, 0x31, 0x35, 0x54, 0x32, 0x32, 0x3a, 0x31, 0x38, 0x3a, 0x35, 0x31, 0x2b, 0x30, 0x38, 0x3a, 0x30, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x2d, 0x13, 0x20, 0xd9, 0x52, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x32, 0x30, 0x31, 0x35, 0x2d, 0x30, 0x39, 0x2d, 0x31, 0x35, 0x54, 0x32, 0x32, 0x3a, 0x31, 0x38, 0x3a, 0x35, 0x34, 0x2b, 0x30, 0x38, 0x3a, 0x30, 0x30}, } messageCount := 6 { resp := FetchResponse{} (&RequestOrResponse{M: &Response{ResponseMessage: &resp}}).Unmarshal(&r) if r.Err != nil { t.Fatal(r.Err) } if len(resp) != 1 || len(resp[0].FetchMessageSetInPartitions) != 1 || len(resp[0].FetchMessageSetInPartitions[0].MessageSet) != messageCount { t.Fatal("fail to parse truncated message set") } } { r.Reset() size := r.ReadInt32() size -= 2 r.B = r.B[:size+4] (&wipro.Writer{B: r.B}).SetInt32(0, size) r.Reset() messageCount-- resp := FetchResponse{} (&RequestOrResponse{M: &Response{ResponseMessage: &resp}}).Unmarshal(&r) if r.Err != nil { t.Fatal(r.Err) } if len(resp) != 1 || len(resp[0].FetchMessageSetInPartitions) != 1 || len(resp[0].FetchMessageSetInPartitions[0].MessageSet) != 5 { t.Fatal("fail to parse truncated message set") } } }
func (t *OffsetFetchResponse) Unmarshal(r *wipro.Reader) { (*t) = make([]OffsetMetadataInTopic, int(r.ReadInt32())) for i := range *t { (*t)[i].Unmarshal(r) } }
func (t *PartitionAssignments) Unmarshal(r *wipro.Reader) { (*t) = make([]PartitionAssignment, int(r.ReadInt32())) for i := range *t { (*t)[i].Unmarshal(r) } }
func (t *SyncGroupRequest) Unmarshal(r *wipro.Reader) { t.GroupID = r.ReadString() t.GenerationID = r.ReadInt32() t.MemberID = r.ReadString() t.GroupAssignments.Unmarshal(r) }
func (t *MemberWithMetas) Unmarshal(r *wipro.Reader) { (*t) = make([]MemberWithMeta, int(r.ReadInt32())) for i := range *t { (*t)[i].Unmarshal(r) } }
func (t *OffsetMetadataInPartition) Unmarshal(r *wipro.Reader) { t.Partition = r.ReadInt32() t.Offset = r.ReadInt64() t.Metadata = r.ReadString() t.ErrorCode.Unmarshal(r) }
func (t *Subscription) Unmarshal(r *wipro.Reader) { (*t) = make([]string, int(r.ReadInt32())) for i := range *t { (*t)[i] = r.ReadString() } }
func (t *GroupProtocols) Unmarshal(r *wipro.Reader) { (*t) = make([]GroupProtocol, int(r.ReadInt32())) for i := range *t { (*t)[i].Unmarshal(r) } }
func (t *HeartbeatRequest) Unmarshal(r *wipro.Reader) { t.GroupID = r.ReadString() t.GenerationID = r.ReadInt32() t.MemberID = r.ReadString() }
func (t *ErrorInPartition) Unmarshal(r *wipro.Reader) { t.Partition = r.ReadInt32() t.ErrorCode.Unmarshal(r) }