compression

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompressionType

type CompressionType int
const (
	None CompressionType = iota
	Gzip
	Zstd
)

type Compressor

type Compressor interface {
	GetAlgorithm() CompressionType
	Compress(dst, src []byte) []byte
	Close()
}

func NewGzipCompressor

func NewGzipCompressor() Compressor

func NewNoneCompressor

func NewNoneCompressor() Compressor

func NewZstdCompressor

func NewZstdCompressor() Compressor

type Decompressor

type Decompressor interface {
	GetAlgorithm() CompressionType
	Decompress(dst, src []byte) ([]byte, error)
	Close()
}

func NewGzipDeCompressor

func NewGzipDeCompressor() Decompressor

func NewNoneDeCompressor

func NewNoneDeCompressor() Decompressor

func NewZstdDeCompressor

func NewZstdDeCompressor() Decompressor

type GzipCompressor

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

func (*GzipCompressor) Close

func (g *GzipCompressor) Close()

func (*GzipCompressor) Compress

func (g *GzipCompressor) Compress(dst, src []byte) []byte

func (*GzipCompressor) GetAlgorithm

func (g *GzipCompressor) GetAlgorithm() CompressionType

type GzipDeCompressor

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

func (*GzipDeCompressor) Close

func (g *GzipDeCompressor) Close()

func (*GzipDeCompressor) Decompress

func (g *GzipDeCompressor) Decompress(dst, src []byte) ([]byte, error)

func (*GzipDeCompressor) GetAlgorithm

func (g *GzipDeCompressor) GetAlgorithm() CompressionType

type NoneCompressor

type NoneCompressor struct {
}

func (*NoneCompressor) Close

func (n *NoneCompressor) Close()

func (*NoneCompressor) Compress

func (n *NoneCompressor) Compress(dst, src []byte) []byte

func (*NoneCompressor) GetAlgorithm

func (n *NoneCompressor) GetAlgorithm() CompressionType

type NoneDeCompressor

type NoneDeCompressor struct {
}

func (*NoneDeCompressor) Close

func (n *NoneDeCompressor) Close()

func (*NoneDeCompressor) Decompress

func (n *NoneDeCompressor) Decompress(dst, src []byte) ([]byte, error)

func (*NoneDeCompressor) GetAlgorithm

func (n *NoneDeCompressor) GetAlgorithm() CompressionType

type ZstdCompressor

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

func (*ZstdCompressor) Close

func (z *ZstdCompressor) Close()

func (*ZstdCompressor) Compress

func (z *ZstdCompressor) Compress(dst, src []byte) []byte

func (*ZstdCompressor) GetAlgorithm

func (z *ZstdCompressor) GetAlgorithm() CompressionType

type ZstdDeCompressor

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

func (*ZstdDeCompressor) Close

func (z *ZstdDeCompressor) Close()

func (*ZstdDeCompressor) Decompress

func (z *ZstdDeCompressor) Decompress(dst, src []byte) ([]byte, error)

func (*ZstdDeCompressor) GetAlgorithm

func (z *ZstdDeCompressor) GetAlgorithm() CompressionType

Jump to

Keyboard shortcuts

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