MCPcopy
hub / github.com/segmentio/kafka-go / loadRecords

Function loadRecords

protocol/prototest/reflect.go:120–139  ·  view source on GitHub ↗
(r protocol.RecordReader)

Source from the content-addressed store, hash-verified

118}
119
120func loadRecords(r protocol.RecordReader) []memoryRecord {
121 records := []memoryRecord{}
122
123 for {
124 rec, err := r.ReadRecord()
125 if err != nil {
126 if errors.Is(err, io.EOF) {
127 return records
128 }
129 panic(err)
130 }
131 records = append(records, memoryRecord{
132 offset: rec.Offset,
133 time: rec.Time,
134 key: readAll(rec.Key),
135 value: readAll(rec.Value),
136 headers: rec.Headers,
137 })
138 }
139}
140
141func readAll(bytes protocol.Bytes) []byte {
142 if bytes != nil {

Callers 1

loadValueFunction · 0.85

Calls 2

readAllFunction · 0.70
ReadRecordMethod · 0.65

Tested by

no test coverage detected