compression

package module
v0.84.6 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 2 Imported by: 16 modules, 15 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package compression provides a set of constants describing the compression options

Index

Constants

View Source
const GzipEncoding = "gzip"

GzipEncoding is the content-encoding value for Gzip

View Source
const GzipKind = "gzip"

GzipKind defines a const value for the gzip compressor

View Source
const NoneKind = "none"

NoneKind defines a const value for disabling compression

View Source
const ZlibEncoding = "deflate"

ZlibEncoding is the content-encoding value for Zlib

View Source
const ZlibKind = "zlib"

ZlibKind defines a const value for the zlib compressor

View Source
const ZstdEncoding = "zstd"

ZstdEncoding is the content-encoding value for Zstd

View Source
const ZstdKind = "zstd"

ZstdKind defines a const value for the zstd compressor

Variables

This section is empty.

Functions

This section is empty.

Types

type Compressor added in v0.63.0

type Compressor interface {
	Compress(src []byte) ([]byte, error)
	Decompress(src []byte) ([]byte, error)
	CompressBound(sourceLen int) int
	ContentEncoding() string
	NewStreamCompressor(output *bytes.Buffer) StreamCompressor
}

Compressor is the interface that a given compression algorithm needs to implement

type StreamCompressor added in v0.63.0

type StreamCompressor interface {
	io.WriteCloser
	Flush() error
}

StreamCompressor is the interface that the compression algorithm should implement for streaming

type ZstdCompressionLevel added in v0.63.0

type ZstdCompressionLevel int

ZstdCompressionLevel is a wrapper type over int for the compression level for zstd compression, if that is selected.

Directories

Path Synopsis
Package gzipimpl provides a set of functions for compressing with zlib / zstd / gzip
Package gzipimpl provides a set of functions for compressing with zlib / zstd / gzip
Package noopimpl provides a set of functions for compressing with zlib / zstd
Package noopimpl provides a set of functions for compressing with zlib / zstd
Package zlibimpl provides a set of functions for compressing with zlib
Package zlibimpl provides a set of functions for compressing with zlib
Package zstdimpl provides a set of functions for compressing with zstd
Package zstdimpl provides a set of functions for compressing with zstd
Package zstdimpl provides a set of functions for compressing with zstd
Package zstdimpl provides a set of functions for compressing with zstd
Package selector provides correct compression impl to fx
Package selector provides correct compression impl to fx

Jump to

Keyboard shortcuts

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