MCPcopy Create free account
hub / github.com/IBM/sarama / decode

Function decode

encoder_decoder.go:75–93  ·  view source on GitHub ↗

decode takes bytes and a decoder and fills the fields of the decoder from the bytes, interpreted using Kafka's encoding rules.

(buf []byte, in decoder, metricRegistry metrics.Registry)

Source from the content-addressed store, hash-verified

73// decode takes bytes and a decoder and fills the fields of the decoder from the bytes,
74// interpreted using Kafka's encoding rules.
75func decode(buf []byte, in decoder, metricRegistry metrics.Registry) error {
76 if buf == nil {
77 return nil
78 }
79 helper := realDecoder{
80 raw: buf,
81 registry: metricRegistry,
82 }
83 err := in.decode(&helper)
84 if err != nil {
85 return err
86 }
87
88 if helper.off != len(buf) {
89 return PacketDecodingError{fmt.Sprintf("invalid length: buf=%d decoded=%d %#v", len(buf), helper.off, in)}
90 }
91
92 return nil
93}
94
95func versionedDecode(buf []byte, in versionedDecoder, version int16, metricRegistry metrics.Registry) error {
96 if buf == nil {

Callers 15

GetMembersMethod · 0.85
GetMemberAssignmentMethod · 0.85
GetMemberMetadataMethod · 0.85
decodeRequestFunction · 0.85
testDecodableFunction · 0.85
TestSubscriptionMetadataFunction · 0.85
GetMemberAssignmentMethod · 0.85
decodeMethod · 0.85

Calls 1

decodeMethod · 0.65