blockcompress

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BlockCompress_name = map[int32]string{
		0: "BlockCompress_NONE",
		1: "BlockCompress_SNAPPY",
		2: "BlockCompress_S2",
		3: "BlockCompress_LZ4",
		4: "BlockCompress_ZSTD",
	}
	BlockCompress_value = map[string]int32{
		"BlockCompress_NONE":   0,
		"BlockCompress_SNAPPY": 1,
		"BlockCompress_S2":     2,
		"BlockCompress_LZ4":    3,
		"BlockCompress_ZSTD":   4,
	}
)

Enum value maps for BlockCompress.

View Source
var File_github_com_aperturerobotics_bifrost_util_blockcompress_blockcompress_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type BlockCompress

type BlockCompress int32

BlockCompress sets the type of compression to use.

const (
	// BlockCompress_NONE indicates no compression.
	BlockCompress_BlockCompress_NONE BlockCompress = 0
	// BlockCompress_SNAPPY indicates Snappy compression.
	BlockCompress_BlockCompress_SNAPPY BlockCompress = 1
	// BlockCompress_S2 indicates S2 compression.
	//
	// S2 is an extension of snappy. S2 is aimed for high throughput, which is why
	// it features concurrent compression for bigger payloads. Decoding is
	// compatible with Snappy compressed content, but content compressed with S2
	// cannot be decompressed by Snappy. This means that S2 can seamlessly replace
	// Snappy without converting compressed content. S2 is designed to have high
	// throughput on content that cannot be compressed. This is important so you
	// don't have to worry about spending CPU cycles on already compressed data.
	//
	// Reference: https://github.com/klauspost/compress/tree/master/s2
	BlockCompress_BlockCompress_S2 BlockCompress = 2
	// BlockCompress_LZ4 indicates LZ4 compression.
	BlockCompress_BlockCompress_LZ4 BlockCompress = 3
	// BlockCompress_ZSTD indicates z-standard compression.
	//
	// Zstandard is a real-time compression algorithm, providing high compression
	// ratios. It offers a very wide range of compression / speed trade-off, while
	// being backed by a very fast decoder. A high performance compression
	// algorithm is implemented.
	BlockCompress_BlockCompress_ZSTD BlockCompress = 4
)

func (BlockCompress) BuildCompressStream

func (b BlockCompress) BuildCompressStream(w io.ReadWriteCloser) (io.ReadWriteCloser, error)

BuildCompressStream builds the compression stream for the given block crypto type.

func (BlockCompress) Descriptor added in v0.2.0

func (BlockCompress) Enum added in v0.2.0

func (x BlockCompress) Enum() *BlockCompress

func (BlockCompress) EnumDescriptor deprecated

func (BlockCompress) EnumDescriptor() ([]byte, []int)

Deprecated: Use BlockCompress.Descriptor instead.

func (BlockCompress) Number added in v0.2.0

func (BlockCompress) String

func (x BlockCompress) String() string

func (BlockCompress) Type added in v0.2.0

type Lz4Stream

type Lz4Stream struct {
	io.ReadWriteCloser
	// contains filtered or unexported fields
}

Lz4Stream implements a lz4 compression backed stream.

func NewLz4Stream

func NewLz4Stream(conn io.ReadWriteCloser) *Lz4Stream

NewLz4Stream constructs a new cmp compression stream.

func (*Lz4Stream) Close

func (c *Lz4Stream) Close() error

Close implements io.ReadWriteCloser

func (*Lz4Stream) Read

func (c *Lz4Stream) Read(p []byte) (n int, err error)

Read implements io.ReadWriteCloser.

func (*Lz4Stream) Write

func (c *Lz4Stream) Write(p []byte) (n int, err error)

Write implements io.ReadWriteCloser.

type S2Stream

type S2Stream struct {
	io.ReadWriteCloser
	// contains filtered or unexported fields
}

S2Stream implements a s2 compression backed stream.

func NewS2Stream

func NewS2Stream(conn io.ReadWriteCloser) *S2Stream

NewS2Stream constructs a new s2 compression stream.

func (*S2Stream) Close

func (c *S2Stream) Close() error

Close implements io.ReadWriteCloser

func (*S2Stream) Read

func (c *S2Stream) Read(p []byte) (n int, err error)

Read implements io.ReadWriteCloser.

func (*S2Stream) Write

func (c *S2Stream) Write(p []byte) (n int, err error)

Write implements io.ReadWriteCloser.

type SnappyStream

type SnappyStream struct {
	io.ReadWriteCloser
	// contains filtered or unexported fields
}

SnappyStream implements a snappy compression backed stream.

func NewSnappyStream

func NewSnappyStream(conn io.ReadWriteCloser) *SnappyStream

NewSnappyStream constructs a new snappy compression stream.

func (*SnappyStream) Close

func (c *SnappyStream) Close() error

Close implements io.ReadWriteCloser

func (*SnappyStream) Read

func (c *SnappyStream) Read(p []byte) (n int, err error)

Read implements io.ReadWriter.

func (*SnappyStream) Write

func (c *SnappyStream) Write(p []byte) (n int, err error)

Write implements io.ReadWriter.

type ZStdStream

type ZStdStream struct {
	io.ReadWriteCloser
	// contains filtered or unexported fields
}

ZStdStream implements a zstd compression backed stream.

func NewZStdStream

func NewZStdStream(conn io.ReadWriteCloser) *ZStdStream

NewZStdStream constructs a new cmp compression stream.

func (*ZStdStream) Close

func (c *ZStdStream) Close() error

Close implements io.ReadWriteCloser

func (*ZStdStream) Read

func (c *ZStdStream) Read(p []byte) (n int, err error)

Read implements io.ReadWriteCloser.

func (*ZStdStream) Write

func (c *ZStdStream) Write(p []byte) (n int, err error)

Write implements io.ReadWriteCloser.

Jump to

Keyboard shortcuts

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