compresser

package
v0.0.0-...-de11b45 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompType

type CompType byte
const (
	CompTypeNone CompType = iota
	CompTypeGzip
)

type Compressor

type Compressor interface {
	// Do compresses p into w.
	Do(w io.Writer, p []byte) error
	// Type returns the compression algorithm the Compressor uses.
	Type() CompType
}

Compressor defines the interface gRPC uses to compress a message.

func NewGZIPCompressor

func NewGZIPCompressor() Compressor

NewGZIPCompressor creates a Compressor based on GZIP.

type Decompressor

type Decompressor interface {
	// Do reads the data from r and uncompress them.
	Do(r io.Reader) ([]byte, error)
	// Type returns the compression algorithm the Decompressor uses.
	Type() CompType
}

Decompressor defines the interface gRPC uses to decompress a message.

func NewGZIPDecompressor

func NewGZIPDecompressor() Decompressor

NewGZIPDecompressor creates a Decompressor based on GZIP.

Jump to

Keyboard shortcuts

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