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

Method decode

records.go:82–98  ·  view source on GitHub ↗
(pd packetDecoder)

Source from the content-addressed store, hash-verified

80}
81
82func (r *Records) decode(pd packetDecoder) error {
83 if r.recordsType == unknownRecords {
84 if err := r.setTypeFromMagic(pd); err != nil {
85 return err
86 }
87 }
88
89 switch r.recordsType {
90 case legacyRecords:
91 r.MsgSet = &MessageSet{}
92 return r.MsgSet.decode(pd)
93 case defaultRecords:
94 r.RecordBatch = &RecordBatch{}
95 return r.RecordBatch.decode(pd)
96 }
97 return fmt.Errorf("unknown records type: %v", r.recordsType)
98}
99
100func (r *Records) numRecords() (int, error) {
101 if r.recordsType == unknownRecords {

Callers 2

decodeMethod · 0.95
decodeMethod · 0.95

Calls 3

setTypeFromMagicMethod · 0.95
decodeMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected