compression

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: BSD-3-Clause Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compressor

type Compressor interface {
	Compress([]byte) ([]byte, error)
	Decompress([]byte) ([]byte, error)
	CompressStream(io.Reader, io.Writer) error
	DecompressStream(io.Reader, io.Writer) error
	GetLevel() int
}

type Flate

type Flate struct {
	Level int
}

func (*Flate) Compress

func (f *Flate) Compress(in []byte) ([]byte, error)

func (*Flate) CompressStream

func (f *Flate) CompressStream(in io.Reader, out io.Writer) error

func (*Flate) Decompress

func (f *Flate) Decompress(in []byte) ([]byte, error)

func (*Flate) DecompressStream

func (f *Flate) DecompressStream(in io.Reader, out io.Writer) error

func (*Flate) GetLevel

func (f *Flate) GetLevel() int

type Gzip

type Gzip struct {
	Level int
}

func (*Gzip) Compress

func (g *Gzip) Compress(in []byte) ([]byte, error)

func (*Gzip) CompressStream

func (g *Gzip) CompressStream(in io.Reader, out io.Writer) error

func (*Gzip) Decompress

func (g *Gzip) Decompress(in []byte) ([]byte, error)

func (*Gzip) DecompressStream

func (g *Gzip) DecompressStream(in io.Reader, out io.Writer) error

func (*Gzip) GetLevel

func (g *Gzip) GetLevel() int

type Zlib

type Zlib struct {
	Level int
}

func (*Zlib) Compress

func (zl *Zlib) Compress(in []byte) ([]byte, error)

func (*Zlib) CompressStream

func (zl *Zlib) CompressStream(in io.Reader, out io.Writer) error

func (*Zlib) Decompress

func (zl *Zlib) Decompress(in []byte) ([]byte, error)

func (*Zlib) DecompressStream

func (zl *Zlib) DecompressStream(in io.Reader, out io.Writer) error

func (*Zlib) GetLevel

func (zl *Zlib) GetLevel() int

type Zstd

type Zstd struct {
	Level int
}

func (*Zstd) Compress

func (z *Zstd) Compress(in []byte) ([]byte, error)

func (*Zstd) CompressStream

func (z *Zstd) CompressStream(in io.Reader, out io.Writer) error

func (*Zstd) Decompress

func (z *Zstd) Decompress(in []byte) ([]byte, error)

func (*Zstd) DecompressStream

func (z *Zstd) DecompressStream(in io.Reader, out io.Writer) error

func (*Zstd) GetLevel

func (z *Zstd) GetLevel() int

Jump to

Keyboard shortcuts

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