Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Extract ¶
func Extract(reader io.Reader, options ExtractOptions) error
Extract extracts a tarball given as a reader interface.
func ExtractFile ¶
func ExtractFile(fileName string, options ExtractOptions) error
ExtractFile extracts a tar file contents.
Types ¶
type Compression ¶
type Compression int
Compression is a compression flag.
const ( NoCompression Compression = iota GzipCompression )
type ExtractOptions ¶
type ExtractOptions struct { // OutDir is a directory where to extract the files. Current working directory by default. OutDir string // Compression indicates is the tarball compressed or not. Compression Compression // StripComponents is like --strip-components of tar utility. It strips first N components from the path by a given depth. StripComponents uint // Files is a list of files to extract. If empty, extract all the files. Files []string // OutFiles is a resulting map passed by user. If non-nil then it will store the mapping from tar file names to file system paths. OutFiles map[string]string }
ExtractOptions is the options for Extract and ExtractFile functions.
Click to show internal directories.
Click to hide internal directories.