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

Function Marshal

kafka.go:74–76  ·  view source on GitHub ↗

Marshal encodes v into a binary representation of the value in the kafka data format. If v is a, or contains struct types, the kafka struct fields are interpreted and may contain one of these values: nullable valid on bytes and strings, encodes as a nullable value compact valid on strings, en

(v interface{})

Source from the content-addressed store, hash-verified

72// encode types based on specific versions of kafka APIs, use the Version type
73// instead.
74func Marshal(v interface{}) ([]byte, error) {
75 return protocol.Marshal(-1, v)
76}
77
78// Unmarshal decodes a binary representation from b into v.
79//

Callers 3

TestMarshalUnmarshalFunction · 0.70
BenchmarkMarshalFunction · 0.70
BenchmarkUnmarshalFunction · 0.70

Calls 1

MarshalFunction · 0.92

Tested by 3

TestMarshalUnmarshalFunction · 0.56
BenchmarkMarshalFunction · 0.56
BenchmarkUnmarshalFunction · 0.56