Documentation
¶
Overview ¶
Package zstd provides a Zstandard (zstd) compression codec for go-service.
This package integrates the zstd algorithm behind the go-service compression abstraction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compressor ¶
type Compressor struct{}
Compressor implements Zstandard (zstd) compression.
It satisfies the `github.com/alexfalkowski/go-service/v2/compress.Compressor` interface.
func NewCompressor ¶
func NewCompressor() *Compressor
NewCompressor constructs a Zstandard (zstd) compressor implementation.
The returned value implements `github.com/alexfalkowski/go-service/v2/compress.Compressor`.
func (*Compressor) Compress ¶
func (c *Compressor) Compress(data []byte) []byte
Compress returns the zstd-compressed representation of data.
This method uses the klauspost/compress zstd encoder.
func (*Compressor) Decompress ¶
func (c *Compressor) Decompress(data []byte) ([]byte, error)
Decompress returns the decompressed representation of data.
An error is returned if data is not valid zstd-encoded content.