compressor

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compressor

type Compressor interface {
	Compress([]byte) ([]byte, error)
	Decompress([]byte) ([]byte, error)
	GetCompressorType() CompressorType
}

type CompressorType

type CompressorType int8
const (
	CompressorNone CompressorType = iota
	CompressorGzip
	CompressorZip
	CompressorSevenz
	CompressorBzip2
	CompressorLz4
	CompressorDefault
	CompressorZstd
	CompressorDeflate
	CompressorMax
)

type DeflateCompress

type DeflateCompress struct{}

func (*DeflateCompress) Compress

func (*DeflateCompress) Compress(data []byte) ([]byte, error)

func (*DeflateCompress) Decompress

func (*DeflateCompress) Decompress(data []byte) ([]byte, error)

func (*DeflateCompress) GetCompressorType

func (*DeflateCompress) GetCompressorType() CompressorType

type Gzip

type Gzip struct {
}

func (*Gzip) Compress

func (g *Gzip) Compress(b []byte) ([]byte, error)

Compress gzip compress

func (*Gzip) Decompress

func (g *Gzip) Decompress(in []byte) ([]byte, error)

Decompress gzip decompress

func (*Gzip) GetCompressorType

func (g *Gzip) GetCompressorType() CompressorType

type Lz4

type Lz4 struct {
}

func (*Lz4) Compress

func (l *Lz4) Compress(data []byte) ([]byte, error)

func (*Lz4) Decompress

func (l *Lz4) Decompress(in []byte) ([]byte, error)

func (*Lz4) GetCompressorType

func (l *Lz4) GetCompressorType() CompressorType

type Zip

type Zip struct{}

func (Zip) Compress

func (z Zip) Compress(data []byte) ([]byte, error)

func (Zip) Decompress

func (z Zip) Decompress(data []byte) ([]byte, error)

func (Zip) GetCompressorType

func (z Zip) GetCompressorType() CompressorType

type Zstd

type Zstd struct{}

func (Zstd) Compress

func (z Zstd) Compress(data []byte) ([]byte, error)

func (Zstd) Decompress

func (z Zstd) Decompress(data []byte) ([]byte, error)

func (Zstd) GetCompressorType

func (z Zstd) GetCompressorType() CompressorType

Jump to

Keyboard shortcuts

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