encoder

package
v0.0.0-...-914eaba Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrDeprecatedLZ4Cust is used to signify the obsoletion of the lz4cust encoding
	ErrDeprecatedLZ4Cust = errors.New("the LZ4 custom implementation has been deprecated, please check out the v4.0.0 README")
)

Functions

This section is empty.

Types

type Encoder

type Encoder interface {

	// Type will return the type of encoder
	Type() encoders.Type

	// Close will close the encoder and release potentially allocated resources
	Close() error

	// Compress will take the input data slice and write it to dst. The number of written compressed bytes is returned with n
	Compress(data, buf []byte, dst io.Writer) (n int, err error)

	// Decompress reads compressed bytes from src into in, decompresses it into out and returns the number of bytes decompressed.
	// It is the responsibility of the caller to ensure that in and out are properly sized
	Decompress(in, out []byte, src io.Reader) (n int, err error)

	// SetLevel sets / changes the compression level (if supported)
	SetLevel(level int)
}

Encoder provides the GP File with a means to compress and decompress its raw data

func New

func New(t encoders.Type) (Encoder, error)

New creates a new encoder based on an encoder type

func NewByString

func NewByString(t string) (Encoder, error)

NewByString is a convenience method for encoder selection by string rather than enumeration code

Directories

Path Synopsis
Package lz4 implements goDB's Encoder interface for lz4 (de-)compression of flow data
Package lz4 implements goDB's Encoder interface for lz4 (de-)compression of flow data
Package lz4cust implements goDB's Encoder interface for lz4 (de-)compression of flow data
Package lz4cust implements goDB's Encoder interface for lz4 (de-)compression of flow data
Package zstd implements goDB's Encoder interface for ZStandard (de-)compression of flow data
Package zstd implements goDB's Encoder interface for ZStandard (de-)compression of flow data

Jump to

Keyboard shortcuts

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