Documentation
¶
Overview ¶
Package tar contains helper functions for working with tar files
Index ¶
- Constants
- Variables
- func ExtractFile(tr *tar.Reader, hdr *tar.Header, dir string, overwrite bool) error
- func ExtractFileFromTar(tr *tar.Reader, file string) ([]byte, error)
- func ExtractTar(tr *tar.Reader, dir string, overwrite bool, pwl PathWhitelistMap) error
- func HdrToTimespec(hdr *tar.Header) []syscall.Timespec
- func LUtimesNano(path string, ts []syscall.Timespec) error
- type PathWhitelistMap
Constants ¶
Variables ¶
Functions ¶
func ExtractFile ¶ added in v0.2.0
ExtractFile extracts the file described by hdr from the given tarball into the provided directory. If overwrite is true, existing files will be overwritten.
func ExtractFileFromTar ¶ added in v0.2.0
ExtractFileFromTar extracts a regular file from the given tar, returning its contents as a byte slice
func ExtractTar ¶
ExtractTar extracts a tarball (from a tar.Reader) into the given directory if pwl is not nil, only the paths in the map are extracted. If overwrite is true, existing files will be overwritten.
Types ¶
Click to show internal directories.
Click to hide internal directories.