Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder provides decompression functionality for supported compression types. It is agnostic to the content being decompressed, operating on byte slices of serialized data streams. The decoder maintains internal state for Zstd decompression and can handle multiple compression types including None, Snappy, and Zstd.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder provides compression encoding functionality for supported compression types. It is agnostic to the content being compressed, operating on byte slices of serialized data streams. The encoder maintains internal state for Zstd compression and can handle multiple compression types including None, Snappy, and Zstd.
func NewEncoder ¶
NewEncoder creates a new Encoder. Returns an error if the zstd encoder cannot be initialized.
func (*Encoder) Encode ¶
Encode returns the encoded form of src for the given compression type. It also returns the indicator if the compression was performed. Encode may skip compressing for None type, but also when src is too large e.g. for Snappy block format.
The buf is used as a buffer for returned encoding, and it must not overlap with src. It is valid to pass a nil buf.