Documentation ¶
Overview ¶
Package archive contains traversal utilities for ZIP and tar archives with gzip, bzip2, xz, and LZ4 compression.
Index ¶
- func NewXZReader(r io.Reader) (io.ReadCloser, error)
- func OpenSingleFileZip(filename string) (io.ReadCloser, string, error)
- func Walk(r io.Reader, filename string, walk WalkFunc) error
- func WalkFile(filename string, walk WalkFunc) error
- func WalkTar(r io.Reader, filename string, walk WalkFunc) error
- func WalkTarFile(filename string, walk WalkFunc) error
- func WalkZip(r io.ReaderAt, size int64, filename string, walk WalkFunc) error
- func WalkZipFile(filename string, walk WalkFunc) error
- type File
- type WalkFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewXZReader ¶
func NewXZReader(r io.Reader) (io.ReadCloser, error)
NewXZReader returns a reader that decompresses XZ data using system xz, if in PATH, otherwise falling back to a slower Go implementation.
func OpenSingleFileZip ¶
func OpenSingleFileZip(filename string) (io.ReadCloser, string, error)
OpenSingleFileZip opens a zip containing a single file for reading and returns the filename of the contained file.
func Walk ¶
Walk traverses an archive from an io.Reader and executes the given walk function on each file. Supported archive and compression formats: ZIP, tar, gzip, bzip2, xz, and LZ4.
func WalkFile ¶
WalkFile traverses an archive from a file and executes the given walk function on each file. Supported archive and compression formats: ZIP, tar, gzip, bzip2, xz, and LZ4.
func WalkTar ¶
WalkTar traverses a tar archive from an io.Reader and executes the given walk function on each file.
func WalkTarFile ¶
WalkTarFile traverses a tar archive from a file and executes the given walk function on each file.
func WalkZip ¶
WalkZip traverses a ZIP archive from an io.ReaderAt and executes the given walk function on each file.
func WalkZipFile ¶
WalkZipFile traverses a ZIP archive from a file and executes the given walk function on each file.