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

Function NewRecordReader

protocol/record_batch.go:25–34  ·  view source on GitHub ↗

NewRecordReader constructs a reader exposing the records passed as arguments.

(records ...Record)

Source from the content-addressed store, hash-verified

23
24// NewRecordReader constructs a reader exposing the records passed as arguments.
25func NewRecordReader(records ...Record) RecordReader {
26 switch len(records) {
27 case 0:
28 return emptyRecordReader{}
29 default:
30 r := &recordReader{records: make([]Record, len(records))}
31 copy(r.records, records)
32 return r
33 }
34}
35
36// MultiRecordReader merges multiple record batches into one.
37func MultiRecordReader(batches ...RecordReader) RecordReader {

Callers 11

NewRecordReaderFunction · 0.92
TestFetchResponseFunction · 0.92
BenchmarkFetchResponseFunction · 0.92
TestProduceRequestFunction · 0.92
BenchmarkProduceRequestFunction · 0.92
TestRawProduceRequestFunction · 0.92
BenchmarkProduceRequestFunction · 0.92
loadValueFunction · 0.92
TestRecordReaderFunction · 0.70
TestMultiRecordReaderFunction · 0.70
NewControlBatchFunction · 0.70

Calls

no outgoing calls

Tested by 8

TestFetchResponseFunction · 0.74
BenchmarkFetchResponseFunction · 0.74
TestProduceRequestFunction · 0.74
BenchmarkProduceRequestFunction · 0.74
TestRawProduceRequestFunction · 0.74
BenchmarkProduceRequestFunction · 0.74
TestRecordReaderFunction · 0.56
TestMultiRecordReaderFunction · 0.56