compress

package
v0.0.0-...-ca02393 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CompressionAlgoZstd         = CompressionAlgorithm(1)
	CompressionLevelZstdFastest = CompressionLevel(zstd.SpeedFastest)
	CompressionLevelZstdDefault = CompressionLevel(zstd.SpeedDefault) // "pretty fast" compression
	CompressionLevelZstdBetter  = CompressionLevel(zstd.SpeedBetterCompression)
	CompressionLevelZstdBest    = CompressionLevel(zstd.SpeedBestCompression)

	CompressionAlgoZstdCgo         = CompressionAlgorithm(2)
	CompressionLevelZstdCgoFastest = CompressionLevel(zstdcgo.BestSpeed)          // 1
	CompressionLevelZstdCgoDefault = CompressionLevel(zstdcgo.DefaultCompression) // 5
	CompressionLevelZstdCgoBest    = CompressionLevel(zstdcgo.BestCompression)    // 20
)

Functions

func DeserializeSettings

func DeserializeSettings(s string) (CompressionAlgorithm, CompressionLevel, error)

DeserializeSettings deserializes the compression settings.

func NewSettings

func NewSettings(algo, level string) (CompressionAlgorithm, CompressionLevel, error)

func SerializeSettings

func SerializeSettings(algo CompressionAlgorithm, level CompressionLevel) string

SerializeSettings serializes the compression settings.

Types

type CompressionAlgorithm

type CompressionAlgorithm int

CompressionAlgorithm is the interface that wraps the compression algorithm method.

func (CompressionAlgorithm) String

func (c CompressionAlgorithm) String() string

type CompressionLevel

type CompressionLevel int

CompressionLevel is the interface that wraps the compression level method.

func (CompressionLevel) String

func (c CompressionLevel) String() string

type Compressor

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

func New

func (*Compressor) Close

func (c *Compressor) Close() error

func (*Compressor) Compress

func (c *Compressor) Compress(src []byte) ([]byte, error)

func (*Compressor) Decompress

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

Jump to

Keyboard shortcuts

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