Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface {
// Return the max possible size for a compressed buffer given the uncompressed data size
CompressMaxSize(originalSize int) int
// Compress a []byte, the param is a []byte with the uncompressed content.
// The reader/writer indexes will not be modified. The return is a []byte
// with the compressed content.
Compress(dst, src []byte) []byte
// Decompress a []byte. The buffer needs to have been compressed with the matching Encoder.
// The src is compressed content. If dst is passed, the decompressed data will be written there
// The return were the result will be passed, if err is nil, the buffer was decompressed, no nil otherwise.
Decompress(dst, src []byte, originalSize int) ([]byte, error)
// Returns a new instance of the same provider, with the same exact configuration
Clone() Provider
// Close the compressor
io.Closer
}
Provider is a interface of compression providers
func NewNoopProvider ¶
func NewNoopProvider() Provider
NewNoopProvider returns a Provider interface that does not compress the data
func NewZStdProvider ¶
Click to show internal directories.
Click to hide internal directories.