archive

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotImplemented used for routines that need to be developed still
	ErrNotImplemented = errors.New("This archive routine is not implemented yet")
	// ErrXzUnsupported because there isn't a Go package for this and I'm
	// avoiding dependencies on external binaries
	ErrXzUnsupported = errors.New("Xz compression is currently unsupported")
)

Functions

func Decompress

func Decompress(r io.Reader) (io.Reader, error)

Decompress extracts gzip and bzip streams

func Extract

func Extract(ctx context.Context, path string, r io.Reader, opts ...TarOpts) error

Extract Tar

func Tar

func Tar(ctx context.Context, path string, w io.Writer, opts ...TarOpts) error

Tar creation

func Uncompressed

func Uncompressed(to *tarOpts)

Uncompressed option to tar (noop)

Types

type CompressType

type CompressType int

CompressType identifies the detected compression type

const (
	// CompressNone detected no compression
	CompressNone CompressType = iota
	// CompressBzip2 compression
	CompressBzip2
	// CompressGzip compression
	CompressGzip
	// CompressXz compression
	CompressXz
)

func DetectCompression

func DetectCompression(head []byte) CompressType

DetectCompression identifies the compression type based on the first few bytes

type TarOpts

type TarOpts func(*tarOpts)

TarOpts configures options for Create/Extract tar

Jump to

Keyboard shortcuts

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