Help us shape the future of Go! Take the 2026 Go Developer Survey

compression

package
v0.15.6 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2025 License: BSD-3-Clause Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMaxSizeCompressor = errors.New("invalid compressor max size")
	ErrDecompressedMsgTooLarge  = errors.New("decompressed msg too large")
	ErrMsgTooLarge              = errors.New("msg too large to be compressed")
)

Functions

This section is empty.

Types

type Compressor

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

Compressor compress and decompresses messages. Decompress is the inverse of Compress. Decompress(Compress(msg)) == msg.

func NewNoCompressor

func NewNoCompressor() Compressor

func NewZstdCompressor

func NewZstdCompressor(maxSize int64) (Compressor, error)

type Type

type Type byte
const (
	TypeNone Type = iota + 1
	TypeZstd
)

func TypeFromString

func TypeFromString(s string) (Type, error)

func (Type) MarshalJSON

func (t Type) MarshalJSON() ([]byte, error)

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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