MCPcopy
hub / github.com/IBM/sarama / nextOffset

Method nextOffset

records.go:208–222  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

206}
207
208func (r *Records) nextOffset() (*int64, error) {
209 switch r.recordsType {
210 case unknownRecords:
211 return nil, nil
212 case legacyRecords:
213 return nil, nil
214 case defaultRecords:
215 if r.RecordBatch == nil {
216 return nil, nil
217 }
218 nextOffset := r.RecordBatch.LastOffset() + 1
219 return &nextOffset, nil
220 }
221 return nil, fmt.Errorf("unknown records type: %v", r.recordsType)
222}
223
224func magicValue(pd packetDecoder) (int8, error) {
225 return pd.peekInt8(magicOffset)

Callers 3

decodeMethod · 0.95
TestLegacyRecordsFunction · 0.80
TestDefaultRecordsFunction · 0.80

Calls 2

LastOffsetMethod · 0.80
ErrorfMethod · 0.65

Tested by 2

TestLegacyRecordsFunction · 0.64
TestDefaultRecordsFunction · 0.64