Documentation ¶
Overview ¶
Package compr provides a unified interface wrapping third-party compression libraries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeZstd ¶
DecodeZstd calls DecodeAll on the global zstd decoder.
See: (*zstd.Decoder).DecodeAll
Types ¶
type Compressor ¶
type Compressor interface { // Name is the name of the compression algorithm. Name() string // Compress should append the compressed contents // of src to dst and return the result. Compress(src, dst []byte) []byte }
Compressor describes the interface that CompressionWriter needs a compression algorithm to implement.
func Compression ¶
func Compression(name string) Compressor
Compression selects a compression algorithm by name. The returned Compressor will return the same value for Compressor.Name as the specified name.
type Decompressor ¶
type Decompressor interface { // Name is the name of the compression algorithm. // See also Compressor.Name. Name() string // Decompress decompresses source data // into dst. It should error out if // dst is not large enough to fit the // encoded source data. // // It must be safe to make multiple // calls to Decompress simultaneously // from different goroutines. Decompress(src, dst []byte) error }
Decompressor is the interface that a CompressionReader uses to decompress blocks.
func Decompression ¶
func Decompression(name string) Decompressor
Click to show internal directories.
Click to hide internal directories.