compress

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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