tar

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSourceNotReachable means that given source is not reachable.
	ErrSourceNotReachable = errors.New("source not reachable")
	// ErrArchiveNotReadable means that given archive not readable/corrupted.
	ErrArchiveNotReadable = errors.New("archive not readable")
)

Functions

This section is empty.

Types

type Archive

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

Archive implements archive for tar.

func New

func New(logger log.Logger, root string, skipSymlinks bool) *Archive

New creates an archive that uses the .tar file format.

func (*Archive) Create

func (a *Archive) Create(srcs []string, w io.Writer) (int64, error)

Create writes content of the given source to an archive, returns written bytes.

func (*Archive) Extract

func (a *Archive) Extract(dst string, r io.Reader) (int64, error)

Extract reads content from the given archive reader and restores it to the destination, returns written bytes. nolint: cyclop

Jump to

Keyboard shortcuts

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