Categorygithub.com/andrewarchi/archive
modulepackage
0.0.0-20210213193640-3a6449eed2ec
Repository: https://github.com/andrewarchi/archive.git
Documentation: pkg.go.dev

# README

archive

Package archive contains traversal utilities for ZIP and tar archives with gzip, bzip2, xz, and LZ4 compression.

Clients include andrewarchi/browser and andrewarchi/urlhero.

License

This project is made available under the Mozilla Public License.

# Functions

Extract returns a WalkFunc that extracts the files in an archive to the given directory.
NewXZReader returns a reader that decompresses XZ data using system xz, if in PATH, otherwise falling back to a slower Go implementation.
OpenSingleFileZip opens a zip containing a single file for reading and returns the filename of the contained file.
Walk traverses an archive from an io.Reader and executes the given walk function on each file.
WalkFile traverses an archive from a file and executes the given walk function on each file.
WalkTar traverses a tar archive from an io.Reader and executes the given walk function on each file.
WalkTarFile traverses a tar archive from a file and executes the given walk function on each file.
WalkZip traverses a ZIP archive from an io.ReaderAt and executes the given walk function on each file.
WalkZipFile traverses a ZIP archive from a file and executes the given walk function on each file.

# Interfaces

File exposes a common interface for files in an archive.

# Type aliases

WalkFunc is the type of function that is called for each file visited.