Documentation
¶
Index ¶
- Constants
- Variables
- type Brotli
- func (b *Brotli) Compress(in []byte) ([]byte, error)
- func (b *Brotli) CompressStream(in io.Reader, out io.Writer) error
- func (b *Brotli) Decompress(in []byte) ([]byte, error)
- func (b *Brotli) DecompressStream(in io.Reader, out io.Writer) error
- func (b *Brotli) GetLevel() int
- func (b *Brotli) GetModes() []int
- func (b *Brotli) GetName() string
- func (b *Brotli) SetLevel(level int)
- type Compressor
- type Flate
- func (f *Flate) Compress(in []byte) ([]byte, error)
- func (f *Flate) CompressStream(in io.Reader, out io.Writer) error
- func (f *Flate) Decompress(in []byte) ([]byte, error)
- func (f *Flate) DecompressStream(in io.Reader, out io.Writer) error
- func (f *Flate) GetLevel() int
- func (f *Flate) GetModes() []int
- func (f *Flate) GetName() string
- func (f *Flate) SetLevel(level int)
- type Gzip
- func (g *Gzip) Compress(in []byte) ([]byte, error)
- func (g *Gzip) CompressStream(in io.Reader, out io.Writer) error
- func (g *Gzip) Decompress(in []byte) ([]byte, error)
- func (g *Gzip) DecompressStream(in io.Reader, out io.Writer) error
- func (g *Gzip) GetLevel() int
- func (g *Gzip) GetModes() []int
- func (g *Gzip) GetName() string
- func (g *Gzip) SetLevel(level int)
- type Zlib
- func (zl *Zlib) Compress(in []byte) ([]byte, error)
- func (zl *Zlib) CompressStream(in io.Reader, out io.Writer) error
- func (zl *Zlib) Decompress(in []byte) ([]byte, error)
- func (zl *Zlib) DecompressStream(in io.Reader, out io.Writer) error
- func (zl *Zlib) GetLevel() int
- func (zl *Zlib) GetModes() []int
- func (zl *Zlib) GetName() string
- func (zl *Zlib) SetLevel(level int)
- type Zstd
- func (z *Zstd) Compress(in []byte) ([]byte, error)
- func (z *Zstd) CompressStream(in io.Reader, out io.Writer) error
- func (z *Zstd) Decompress(in []byte) ([]byte, error)
- func (z *Zstd) DecompressStream(in io.Reader, out io.Writer) error
- func (z *Zstd) GetLevel() int
- func (z *Zstd) GetModes() []int
- func (z *Zstd) GetName() string
- func (z *Zstd) SetLevel(level int)
Constants ¶
View Source
const ( // Predefined compression levels. // // Compatible with flate, gzip, zlib. NoCompression int = 0 BestSpeed int = 1 BestCompression int = 9 DefaultCompression int = -1 ConstantCompression int = -2 HuffmanOnly int = -2 // Source: https://pkg.go.dev/github.com/klauspost/compress/gzip#pkg-constants // // StatelessCompression will do compression but without maintaining any state // between Write calls. // There will be no memory kept between Write calls, // but compression and speed will be suboptimal. // Because of this, the size of actual Write calls will affect output size. StatelessCompression int = -3 // Zstd specific predefined compression levels. // // Compatible with only zstd. ZstdSpeedBestCompression int = 11 ZstdSpeedDefault int = 3 ZstdSpeedFastest int = 1 ZstdSpeedBetterCompression int = 7 // Brotil specific predefined compression levels. // // Compatible with only brotli. BrotliBestCompression int = 11 BrotliDefaultCompression int = 6 BrotliBestSpeed int = 0 )
Variables ¶
View Source
var ErrMissingCompressionLevel = errors.New("missing compression level parameter")
Functions ¶
This section is empty.
Types ¶
type Brotli ¶ added in v0.0.2
type Brotli struct { Level int // contains filtered or unexported fields }
func (*Brotli) CompressStream ¶ added in v0.0.2
func (*Brotli) DecompressStream ¶ added in v0.0.2
type Compressor ¶
type Flate ¶
type Flate struct { Level int // contains filtered or unexported fields }
func (*Flate) DecompressStream ¶
Click to show internal directories.
Click to hide internal directories.