compressor

package
v1.172.5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidKind = errors.New("invalid kind")

ErrInvalidKind for compressor.

Module for fx.

Functions

This section is empty.

Types

type Compressor

type Compressor interface {
	Compress(src []byte) []byte
	Decompress(src []byte) ([]byte, error)
}

Compressor allows to have different ways to compress/decompress.

type Factory added in v1.156.0

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

Factory of compressor.

func NewFactory added in v1.156.0

func NewFactory() *Factory

NewFactory for compressor.

func (*Factory) Create added in v1.156.0

func (f *Factory) Create(kind string) (Compressor, error)

Create from kind.

func (*Factory) Register added in v1.156.0

func (f *Factory) 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(src []byte) []byte

func (*None) Decompress added in v1.157.0

func (c *None) Decompress(src []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(src []byte) []byte

func (*Snappy) Decompress added in v1.156.0

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

Jump to

Keyboard shortcuts

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