compressor

package
v1.218.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Module for fx.

Functions

This section is empty.

Types

type Compressor

type Compressor interface {
	// Compress data.
	Compress(data []byte) []byte

	// Decompress data.
	Decompress(data []byte) ([]byte, error)
}

Compressor allows to have different ways to compress/decompress.

type Map added in v1.188.0

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

Map of compressor.

func NewMap added in v1.188.0

func NewMap() *Map

NewMap for compressor.

func (*Map) Get added in v1.188.0

func (f *Map) Get(kind string) Compressor

Get from kind.

func (*Map) Register added in v1.188.0

func (f *Map) Register(kind string, c Compressor)

Register kind and compressor.

type None added in v1.157.0

type None struct{}

None for compressor.

func NewNone added in v1.157.0

func NewNone() *None

NewNone compressor.

func (*None) Compress added in v1.157.0

func (c *None) Compress(data []byte) []byte

func (*None) Decompress added in v1.157.0

func (c *None) Decompress(data []byte) ([]byte, error)

type S2 added in v1.175.0

type S2 struct{}

S2 for compressor.

func NewS2 added in v1.175.0

func NewS2() *S2

NewS2 compressor.

func (*S2) Compress added in v1.175.0

func (c *S2) Compress(data []byte) []byte

func (*S2) Decompress added in v1.175.0

func (c *S2) Decompress(data []byte) ([]byte, error)

type Snappy added in v1.156.0

type Snappy struct{}

Snappy for compressor.

func NewSnappy

func NewSnappy() *Snappy

NewSnappy compressor.

func (*Snappy) Compress added in v1.156.0

func (c *Snappy) Compress(data []byte) []byte

func (*Snappy) Decompress added in v1.156.0

func (c *Snappy) Decompress(data []byte) ([]byte, error)

type Zstd added in v1.175.0

type Zstd struct{}

Zstd for compressor.

func NewZstd added in v1.175.0

func NewZstd() *Zstd

NewZstd compressor.

func (*Zstd) Compress added in v1.175.0

func (c *Zstd) Compress(data []byte) []byte

func (*Zstd) Decompress added in v1.175.0

func (c *Zstd) Decompress(data []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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