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

Interface Codec

compress/compress.go:89–101  ·  compress/compress.go::Codec

Codec represents a compression codec to encode and decode the messages. See : https://cwiki.apache.org/confluence/display/KAFKA/Compression A Codec must be safe for concurrent access by multiple go routines.

Source from the content-addressed store, hash-verified

87//
88// A Codec must be safe for concurrent access by multiple go routines.
89type Codec interface {
90 // Code returns the compression codec code
91 Code() int8
92
93 // Human-readable name for the codec.
94 Name() string
95
96 // Constructs a new reader which decompresses data from r.
97 NewReader(r io.Reader) io.ReadCloser
98
99 // Constructs a new writer which writes compressed data to w.
100 NewWriter(w io.Writer) io.WriteCloser
101}
102
103var (
104 // The global gzip codec installed on the Codecs table.

Callers 33

bytesMethod · 0.65
bytesMethod · 0.65
bytesMethod · 0.65
compressRecordBatchFunction · 0.65
compressMessageSetFunction · 0.65
NewWriterFunction · 0.65
TestCodecsFunction · 0.65
testEncodeDecodeFunction · 0.65
TestCodecsFunction · 0.65
testEncodeDecodeFunction · 0.65
testCompressedMessagesFunction · 0.65
BenchmarkCompressionFunction · 0.65

Implementers 5

noopCodeccompress/compress_test.go
Codeccompress/zstd/zstd.go
Codeccompress/lz4/lz4.go
Codeccompress/snappy/snappy.go
Codeccompress/gzip/gzip.go

Calls

no outgoing calls

Tested by

no test coverage detected