compression

package
v0.0.0-...-dad441a Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deflate

type Deflate struct{}

func (Deflate) Compress

func (o Deflate) Compress(in []byte, w io.Writer) error

func (Deflate) Extract

func (o Deflate) Extract(f afero.File) ([]byte, error)

type Extractor

type Extractor interface {
	// Extracts compressed data from input stream `f`.
	Extract(f afero.File) ([]byte, error)

	// Compresses `in` data.
	Compress(in []byte, w io.Writer) error
}

The Extractor handles compression and decompression for a specific compression format

func ExtractorFactory

func ExtractorFactory(name string) (Extractor, error)

type Gzip

type Gzip struct{}

func (Gzip) Compress

func (o Gzip) Compress(in []byte, w io.Writer) error

func (Gzip) Extract

func (o Gzip) Extract(f afero.File) ([]byte, error)

type Lz4

type Lz4 struct{}

func (Lz4) Compress

func (o Lz4) Compress(in []byte, w io.Writer) error

func (Lz4) Extract

func (o Lz4) Extract(f afero.File) ([]byte, error)

type Lzf

type Lzf struct {
	CompressedSize uint // deduced from field size
}

func (Lzf) Compress

func (o Lzf) Compress(in []byte, w io.Writer) error

func (Lzf) Extract

func (o Lzf) Extract(f afero.File) ([]byte, error)

type Lzma

type Lzma struct{}

func (Lzma) Compress

func (o Lzma) Compress(in []byte, w io.Writer) error

func (Lzma) Extract

func (o Lzma) Extract(f afero.File) ([]byte, error)

type Lzma2

type Lzma2 struct{}

func (Lzma2) Compress

func (o Lzma2) Compress(in []byte, w io.Writer) error

func (Lzma2) Extract

func (o Lzma2) Extract(f afero.File) ([]byte, error)

type Lzo1x

type Lzo1x struct{}

func (Lzo1x) Compress

func (o Lzo1x) Compress(in []byte, w io.Writer) error

func (Lzo1x) Extract

func (o Lzo1x) Extract(f afero.File) ([]byte, error)

type Lzss

type Lzss struct {
	CompressedSize uint // deduced from field size
}

LZSS is not really working ???, need a better impl.

func (Lzss) Compress

func (o Lzss) Compress(in []byte, w io.Writer) error

func (Lzss) Extract

func (o Lzss) Extract(f afero.File) ([]byte, error)

type Pkware

type Pkware struct{}

PKWARE DCL compressed data (aka blast/explode/implode)

func (Pkware) Compress

func (o Pkware) Compress(in []byte, w io.Writer) error

func (Pkware) Extract

func (o Pkware) Extract(f afero.File) ([]byte, error)

type Zlib

type Zlib struct{}

func (Zlib) Compress

func (o Zlib) Compress(in []byte, w io.Writer) error

func (Zlib) Extract

func (o Zlib) Extract(f afero.File) ([]byte, error)

type ZlibLoose

type ZlibLoose struct{}

ignores compression errors

func (ZlibLoose) Compress

func (o ZlibLoose) Compress(in []byte, w io.Writer) error

func (ZlibLoose) Extract

func (o ZlibLoose) Extract(f afero.File) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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