lz4

package module
v0.0.0-...-12ed8da Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LZ4Compressor

type LZ4Compressor struct{}

LZ4Compressor implements the gocql.Compressor interface and can be used to compress incoming and outgoing frames. According to the Cassandra docs the LZ4 protocol should be preferred over snappy. (For details refer to https://cassandra.apache.org/doc/latest/operating/compression.html)

Implementation note: Cassandra prefixes each compressed block with 4 bytes of the uncompressed block length, written in big endian order. But the LZ4 compression library github.com/pierrec/lz4/v4 does not expect the length field, so it needs to be added to compressed blocks sent to Cassandra, and removed from ones received from Cassandra before decompression.

func (LZ4Compressor) Decode

func (s LZ4Compressor) Decode(data []byte) ([]byte, error)

func (LZ4Compressor) Encode

func (s LZ4Compressor) Encode(data []byte) ([]byte, error)

func (LZ4Compressor) Name

func (s LZ4Compressor) Name() string

Jump to

Keyboard shortcuts

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