compression

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 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 Compressor

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

Compressor is used for compressing gRPC traffic using the snappy library. It implements the grpc.Compressor interface.

func NewCompressor

func NewCompressor() *Compressor

NewCompressor creates a new Compressor instance.

func (*Compressor) Do

func (c *Compressor) Do(writer io.Writer, data []byte) error

Do implements the grpc.Compressor interface, it compresses the data into the specified writer.

func (*Compressor) Type

func (c *Compressor) Type() string

Type implements the grpc.Compressor interface, it returns the algorithm name used by the compressor.

type Decompressor

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

Decompressor is used for decompress gRPC traffic using the snappy library.

func NewDecompressor

func NewDecompressor() *Decompressor

NewDecompressor creates a new decompressor instance. It implements the grpc.Decompressor interface.

func (*Decompressor) Do

func (d *Decompressor) Do(reader io.Reader) ([]byte, error)

Do implements the grpc.Decompressor interface, it read the data from the reader and decompress it into the return []byte.

func (*Decompressor) Type

func (d *Decompressor) Type() string

Type implements the grpc.Decompressor interface. It returns the compression algorithm used by the Decompressor.

Directories

Path Synopsis
Package snappy implements the snappy block-based compression format.
Package snappy implements the snappy block-based compression format.

Jump to

Keyboard shortcuts

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