lib

package
Version: v0.0.0-...-f33ba26 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressStream

func CompressStream(compression Compression, out io.Writer, in io.Reader) (n int64, err error)

CompressStream compress by streaming from in to out.

func DecompressStream

func DecompressStream(compression Compression, out io.Writer, in io.Reader) (n int64, err error)

DecompressStream compress by streaming from in to out.

Types

type Compression

type Compression interface {
	CompressWriter(io.Writer) (io.WriteCloser, error)
	DecompressReader(io.Reader) (io.ReadCloser, error)
}

Compression is an interface to be implemented to standatrize compression mechanisms used by this tool.

type GZIPCompression

type GZIPCompression struct{}

GZIPCompression .

func (GZIPCompression) CompressWriter

func (z GZIPCompression) CompressWriter(out io.Writer) (io.WriteCloser, error)

CompressWriter .

func (GZIPCompression) DecompressReader

func (z GZIPCompression) DecompressReader(in io.Reader) (io.ReadCloser, error)

DecompressReader .

type XZCompression

type XZCompression struct{}

XZCompression .

func (XZCompression) CompressWriter

func (x XZCompression) CompressWriter(out io.Writer) (io.WriteCloser, error)

func (XZCompression) DecompressReader

func (x XZCompression) DecompressReader(in io.Reader) (io.ReadCloser, error)

type XZReaderWithCloser

type XZReaderWithCloser struct {
	// contains filtered or unexported fields
}

XZReaderWithCloser is a wrapper because original fastxz.Reader is not implementing io.ReadCloser correctly (does not return error).

func NewXZReaderWithCloser

func NewXZReaderWithCloser(reader *fastxz.Reader, err error) XZReaderWithCloser

NewXZReaderWithCloser .

func (XZReaderWithCloser) Close

func (zr XZReaderWithCloser) Close() error

Close just wraps fastxz.Reader Close, but return nil as error.

func (XZReaderWithCloser) Read

func (zr XZReaderWithCloser) Read(b []byte) (int, error)

Read wraps fastxz.Reader Read.

type ZSTDCompression

type ZSTDCompression struct{}

ZSTDCompression .

func (ZSTDCompression) CompressWriter

func (z ZSTDCompression) CompressWriter(out io.Writer) (io.WriteCloser, error)

CompressWriter .

func (ZSTDCompression) DecompressReader

func (z ZSTDCompression) DecompressReader(in io.Reader) (io.ReadCloser, error)

DecompressReader .

type ZSTDReaderWithCloser

type ZSTDReaderWithCloser struct {
	// contains filtered or unexported fields
}

ZSTDReaderWithCloser is a wrapper because original zstd.Decoder is not implementing io.ReadCloser correctly (does not return error).

func NewZSTDReaderWithCloser

func NewZSTDReaderWithCloser(reader *zstd.Decoder) ZSTDReaderWithCloser

NewZSTDReaderWithCloser .

func (ZSTDReaderWithCloser) Close

func (zr ZSTDReaderWithCloser) Close() error

Close just wraps zstd.Decoder Close, but return nil as error.

func (ZSTDReaderWithCloser) Read

func (zr ZSTDReaderWithCloser) Read(b []byte) (int, error)

Read wraps zstd.Decoder Read.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL