xtar

package
v0.0.0-...-d69adda Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptySubdir = errors.New("empty tarball subdirectory")

Functions

func Compress

func Compress(dir string) io.ReadCloser

func Extract

func Extract(r *tar.Reader, dir string) error

Extract reads the tarball from r and writes it into dir. Copied and modified from golang.org/x/build/internal/untar.

func ModifyHeaders

func ModifyHeaders(r *tar.Reader, fns ...func(*tar.Header)) io.ReadCloser

func Subdir

func Subdir(r *tar.Reader, subdir string) io.ReadCloser

Subdir reads the tarball from r and streams the files in the given subdirectory to the returned io.ReadCloser as a tarball with the subdirectory's path trimmed from each file's name.

If the subdirectory is empty or non-existent, the returned io.ReadCloser is closed with ErrEmptySubdir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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