Documentation
¶
Index ¶
- Constants
- Variables
- func Compress(dst, src []byte) ([]byte, error)
- func Decompress(dst, src []byte) ([]byte, error)
- func LZ4Compress(dst, src []byte) ([]byte, error)
- func LZ4Decompress(dst, src []byte) ([]byte, error)
- func MinLZCompress(dst, src []byte, level int) ([]byte, error)
- func MinLZDecompress(dst, src []byte) ([]byte, error)
- func S2Compress(dst, src []byte) ([]byte, error)
- func S2Decompress(dst, src []byte) ([]byte, error)
- func SetAlgorithm(name string) error
- func SnappyCompress(dst, src []byte) ([]byte, error)
- func SnappyDecompress(dst, src []byte) ([]byte, error)
- func ZSTDCompress(dst, src []byte, compressionLevel int) ([]byte, error)
- func ZSTDCompressBound(srcSize int) int
- func ZSTDDecompress(dst, src []byte) ([]byte, error)
Constants ¶
const ( SNAPPY = iota S2 ZSTD MINLZ LZ4 )
Variables ¶
var Algorithm = S2
Algorithm is the codec Compress and Decompress use. Segments do not record it, so it must stay the same for an index's lifetime.
var MinLZCompressionLevel = minlz.LevelBalanced
MinLZCompressionLevel is minlz.LevelSuperFast, LevelFastest, LevelBalanced or LevelSmallest.
var ZSTDCompressionLevel = 3 // 1, 3, 9
Functions ¶
func Decompress ¶
func LZ4Compress ¶ added in v1.5.3
LZ4Compress compresses a block using lz4 algorithm. The lz4 block format does not record the decoded size, so the block is prefixed with it as a uvarint.
func LZ4Decompress ¶ added in v1.5.3
LZ4Decompress decompresses a block written by LZ4Compress.
func MinLZCompress ¶ added in v1.5.3
MinLZCompress compresses a block (up to minlz.MaxBlockSize) using minlz algorithm.
func MinLZDecompress ¶ added in v1.5.3
MinLZDecompress decompresses a block using minlz algorithm.
func S2Compress ¶
S2Compress compresses a block using s2 algorithm.
func S2Decompress ¶
S2Decompress decompresses a block using s2 algorithm.
func SetAlgorithm ¶ added in v1.5.3
SetAlgorithm sets Algorithm by name (snappy, s2, zstd, minlz or lz4, case insensitive), as read from user configuration.
func SnappyCompress ¶
SnappyCompress compresses a block using snappy algorithm.
func SnappyDecompress ¶
SnappyDecompress decompresses a block using snappy algorithm.
func ZSTDCompress ¶
ZSTDCompress compresses a block using ZSTD algorithm.
func ZSTDCompressBound ¶
ZSTDCompressBound returns the worst case size needed for a destination buffer. Klauspost ZSTD library does not provide any API for Compression Bound. This calculation is based on the DataDog ZSTD library. See https://pkg.go.dev/github.com/DataDog/zstd#CompressBound
func ZSTDDecompress ¶
ZSTDDecompress decompresses a block using ZSTD algorithm.
Types ¶
This section is empty.