compressor

package
v1.156.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 3 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 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