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

Method call

builder_test.go:245–252  ·  view source on GitHub ↗

call is a convenience method that allows the kafkaWriteBuffer to be used in a functional manner. This is helpful when building nested structures, as the return value can be fed into other fwWB APIs.

(cb func(wb *kafkaWriteBuffer))

Source from the content-addressed store, hash-verified

243// nested structures, as the return value can be fed into
244// other fwWB APIs.
245func (f *kafkaWriteBuffer) call(cb func(wb *kafkaWriteBuffer)) []byte {
246 cb(f)
247 bs := f.Bytes()
248 if bs == nil {
249 bs = []byte{}
250 }
251 return bs
252}
253
254func mustCompress(bs []byte, codec compress.Codec) (res []byte) {
255 buf := bytes.Buffer{}

Callers 4

bytesMethod · 0.80
bytesMethod · 0.80
bytesMethod · 0.80
bytesMethod · 0.80

Calls 1

BytesMethod · 0.95

Tested by

no test coverage detected