module

package
v0.0.0-...-d253ebd Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoCompress          uint32 = 0
	CompressWithGzip    uint32 = 1
	CompressWithSnappy  uint32 = 2
	CompressWithZlib    uint32 = 3
	CompressWithDeflate uint32 = 4
)
View Source
const (
	BestSpeed         = flate.BestSpeed
	BestCompression   = flate.BestCompression
	NormalCompression = flate.DefaultCompression
)

Variables

View Source
var CompressLevel = BestCompression

Functions

This section is empty.

Types

type ChecksumCalculator

type ChecksumCalculator struct{}

* ====== ChecksumCoder ======= *

func (*ChecksumCalculator) Handle

func (coder *ChecksumCalculator) Handle(message *tunnel.WMessage) int64

func (*ChecksumCalculator) Install

func (coder *ChecksumCalculator) Install() bool

func (*ChecksumCalculator) IsRegistered

func (coder *ChecksumCalculator) IsRegistered() bool

type Compress

type Compress interface {
	Name() string
	Id() uint32
	Compress(chunk []byte) ([]byte, error)
	Decompress(compressed []byte) ([]byte, error)
}

func GetCompressorById

func GetCompressorById(id uint32) (Compress, error)

func GetCompressorByName

func GetCompressorByName(name string) (Compress, error)

type Compressor

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

* ====== Compressor ======= *

func (*Compressor) Handle

func (compressor *Compressor) Handle(message *tunnel.WMessage) int64

func (*Compressor) Install

func (compressor *Compressor) Install() bool

func (*Compressor) IsRegistered

func (compressor *Compressor) IsRegistered() bool

type Deflate

type Deflate struct {
	Writable
}

func NewDeflateCompressor

func NewDeflateCompressor() *Deflate

func (*Deflate) Compress

func (deflate *Deflate) Compress(chunk []byte) ([]byte, error)

func (*Deflate) Decompress

func (deflate *Deflate) Decompress(compressed []byte) ([]byte, error)

func (*Deflate) Id

func (deflate *Deflate) Id() uint32

func (*Deflate) Name

func (deflate *Deflate) Name() string

type GZip

type GZip struct {
	Writable
}

func NewGZipCompressor

func NewGZipCompressor() *GZip

func (*GZip) Compress

func (Gzip *GZip) Compress(chunk []byte) ([]byte, error)

func (*GZip) Decompress

func (Gzip *GZip) Decompress(compressed []byte) ([]byte, error)

func (*GZip) Id

func (Gzip *GZip) Id() uint32

func (*GZip) Name

func (Gzip *GZip) Name() string

type Snappy

type Snappy struct {
	Writable
}

func NewSnappyCompressor

func NewSnappyCompressor() *Snappy

func (*Snappy) Compress

func (snappy *Snappy) Compress(chunk []byte) ([]byte, error)

func (*Snappy) Decompress

func (snappy *Snappy) Decompress(compressed []byte) ([]byte, error)

func (*Snappy) Id

func (snappy *Snappy) Id() uint32

func (*Snappy) Name

func (snappy *Snappy) Name() string

type Writable

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

type Zlib

type Zlib struct {
	Writable
}

func NewZlibCompressor

func NewZlibCompressor() *Zlib

func (*Zlib) Compress

func (ZLIB *Zlib) Compress(chunk []byte) ([]byte, error)

func (*Zlib) Decompress

func (ZLIB *Zlib) Decompress(compressed []byte) ([]byte, error)

func (*Zlib) Id

func (zlib *Zlib) Id() uint32

func (*Zlib) Name

func (zlib *Zlib) Name() string

Jump to

Keyboard shortcuts

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