compressor

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompressionI

type CompressionI interface {
	// compresses the given record of bytes
	Compress(record []byte) ([]byte, error)
	// decompresses the given byte buffer
	Decompress(buf []byte) ([]byte, error)

	// compresses the given record of bytes and a buffer where to compress into.
	// if the buffer doesn't fit, it will resize it (truncate/enlarging copy).
	// Thus it's important to use the returned buffer value.
	CompressWithBuf(record []byte, destinationBuffer []byte) ([]byte, error)
	// decompresses the given byte buffer and a buffer where to decompress into.
	// if the buffer doesn't fit, it will resize it (truncate/enlarging copy).
	// Thus it's important to use the returned buffer value.
	DecompressWithBuf(buf []byte, destinationBuffer []byte) ([]byte, error)
}

type GzipCompressor

type GzipCompressor struct {
}

func (*GzipCompressor) Compress

func (c *GzipCompressor) Compress(record []byte) ([]byte, error)

func (*GzipCompressor) CompressWithBuf added in v1.3.0

func (c *GzipCompressor) CompressWithBuf(record []byte, destinationBuffer []byte) ([]byte, error)

func (*GzipCompressor) Decompress

func (c *GzipCompressor) Decompress(buf []byte) ([]byte, error)

func (*GzipCompressor) DecompressWithBuf added in v1.3.0

func (c *GzipCompressor) DecompressWithBuf(buf []byte, destinationBuffer []byte) ([]byte, error)

type SnappyCompressor

type SnappyCompressor struct {
}

func (*SnappyCompressor) Compress

func (c *SnappyCompressor) Compress(record []byte) ([]byte, error)

func (*SnappyCompressor) CompressWithBuf added in v1.3.0

func (c *SnappyCompressor) CompressWithBuf(record []byte, destinationBuffer []byte) ([]byte, error)

func (*SnappyCompressor) Decompress

func (c *SnappyCompressor) Decompress(buf []byte) ([]byte, error)

func (*SnappyCompressor) DecompressWithBuf added in v1.3.0

func (c *SnappyCompressor) DecompressWithBuf(buf []byte, destinationBuffer []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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