compress

package
v2.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SNAPPY = iota
	S2
	ZSTD
)

Variables

View Source
var Algorithm = S2
View Source
var ZSTDCompressionLevel = 3 // 1, 3, 9

Functions

func Compress

func Compress(dst, src []byte) ([]byte, error)

func Decompress

func Decompress(dst, src []byte) ([]byte, error)

func S2Compress

func S2Compress(dst, src []byte) ([]byte, error)

S2Compress compresses a block using s2 algorithm.

func S2Decompress

func S2Decompress(dst, src []byte) ([]byte, error)

S2Decompress decompresses a block using s2 algorithm.

func SnappyCompress

func SnappyCompress(dst, src []byte) ([]byte, error)

SnappyCompress compresses a block using snappy algorithm.

func SnappyDecompress

func SnappyDecompress(dst, src []byte) ([]byte, error)

SnappyDecompress decompresses a block using snappy algorithm.

func ZSTDCompress

func ZSTDCompress(dst, src []byte, compressionLevel int) ([]byte, error)

ZSTDCompress compresses a block using ZSTD algorithm.

func ZSTDCompressBound

func ZSTDCompressBound(srcSize int) int

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

func ZSTDDecompress(dst, src []byte) ([]byte, error)

ZSTDDecompress decompresses a block using ZSTD algorithm.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL