compressor

package
v1.4.12 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BrotliBestCompression = brotli.BestCompression
	BrotliBestSpeed       = brotli.BestSpeed
)
View Source
const (
	GzipBestCompression = gzip.BestCompression
	GzipBestSpeed       = gzip.BestSpeed
)
View Source
const (
	ZlibBestCompression = zlib.BestCompression
	ZlibBestSpeed       = zlib.BestSpeed
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Brotli

type Brotli struct {
	// contains filtered or unexported fields
}

Brotli is brotli typed (http encoding type "br") Compressor.

func NewBrotli

func NewBrotli(level int) *Brotli

NewBrotli creates new brotli typed (http encoding type "br") Compressor.

func (*Brotli) Compress

func (compressor *Brotli) Compress(dst io.Writer, src []byte) error

Compress compressing bytes from src to dst with brotli compressing algo until error occurs or end of src.

type Compressor

type Compressor interface {
	Compress(to io.Writer, from []byte) error
}

Compressor is the interface that wraps the Compress method.

type Gzip

type Gzip struct {
	// contains filtered or unexported fields
}

Gzip is gzip typed (http encoding type "gzip") Compressor.

func NewGzip

func NewGzip(level int) *Gzip

NewGzip creates new gzip typed (http encoding type "gzip") Compressor.

func (*Gzip) Compress

func (compressorPool *Gzip) Compress(dst io.Writer, src []byte) error

Compress compressing bytes from src to dst with gzip compressing algo until error occurs or end of src.

type Zlib

type Zlib struct {
	// contains filtered or unexported fields
}

Zlib is zlib typed (http encoding type "deflate") Compressor.

func NewZlib

func NewZlib(level int) *Zlib

NewZlib creates new zlib typed (http encoding type "deflate") Compressor.

func (*Zlib) Compress

func (compressorPool *Zlib) Compress(dst io.Writer, src []byte) error

Compress compressing bytes from src to dst with zlib compressing algo until error occurs or end of src.

Jump to

Keyboard shortcuts

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