Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NoopProvider = NewNoopProvider() ZLibProvider = NewZLibProvider() Lz4Provider = NewLz4Provider() ZStdProvider = NewZStdProvider() )
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface { // CanCompress checks if the compression method is available under the current version. CanCompress() bool // 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(data []byte) []byte // Decompress a []byte. The buffer needs to have been compressed with the matching Encoder. // The compressedData is compressed content, originalSize is the size of the original content. // The return were the result will be passed, if err is nil, the buffer was decompressed, no nil otherwise. Decompress(compressedData []byte, originalSize int) ([]byte, error) }
Provider is a interface of compression providers
func NewZStdProvider ¶
func NewZStdProvider() Provider
Click to show internal directories.
Click to hide internal directories.