compress

package module
v0.0.0-...-de84184 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Algorithms = []Algorithm{DEFLATE, GZIP, ZLIB, LZW, BZIP2, LZ4, BROTLI, SNAPPY, ZSTD, LZMA}

	ErrUnknown     = errors.New("compression-bench: unknown algorithm")
	ErrUnavailable = errors.New("compression-bench: unavailable algorithm")
)

Functions

func Decode

func Decode(r io.ReadCloser) ([]byte, error)

func Encode

func Encode(w io.WriteCloser, b []byte) error

func NewReader

func NewReader(r io.Reader) io.ReadCloser

Types

type Algorithm

type Algorithm uint8
const (
	DEFLATE Algorithm = iota + 1
	GZIP
	ZLIB
	LZW
	BZIP2
	LZ4
	BROTLI
	SNAPPY
	ZSTD
	LZMA
)

func (Algorithm) BestCompressionWriter

func (a Algorithm) BestCompressionWriter(w io.Writer) (io.WriteCloser, error)

func (Algorithm) BestSpeedWriter

func (a Algorithm) BestSpeedWriter(w io.Writer) (io.WriteCloser, error)

func (Algorithm) DefaultWriter

func (a Algorithm) DefaultWriter(w io.Writer) (io.WriteCloser, error)

func (Algorithm) IsConfigurable

func (a Algorithm) IsConfigurable() bool

func (Algorithm) Name

func (a Algorithm) Name() string

func (Algorithm) Reader

func (a Algorithm) Reader(b []byte) (io.ReadCloser, error)

func (Algorithm) Writer

func (a Algorithm) Writer(w io.Writer) (io.WriteCloser, error)

Jump to

Keyboard shortcuts

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