zstd

package
v2.352.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package zstd provides a Zstandard (zstd) compression codec for go-service.

This package integrates the zstd algorithm behind the go-service compression abstraction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compressor

type Compressor struct{}

Compressor implements Zstandard (zstd) compression.

It satisfies the `github.com/alexfalkowski/go-service/v2/compress.Compressor` interface.

func NewCompressor

func NewCompressor() *Compressor

NewCompressor constructs a Zstandard (zstd) compressor implementation.

The returned value implements `github.com/alexfalkowski/go-service/v2/compress.Compressor`.

func (*Compressor) Compress

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

Compress returns the zstd-compressed representation of data.

This method uses the klauspost/compress zstd encoder.

func (*Compressor) Decompress

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

Decompress returns the decompressed representation of data.

An error is returned if data is not valid zstd-encoded content.

Jump to

Keyboard shortcuts

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