Documentation
¶
Overview ¶
Package archive contains functionality for archiving/unarchiving streams.
Index ¶
Constants ¶
View Source
const ( Uncompressed = Compression(archive.Uncompressed) // Uncompressed represents the uncompressed. Bzip2 = Compression(archive.Bzip2) // Bzip2 is bzip2 compression algorithm. Gzip = Compression(archive.Gzip) // Gzip is gzip compression algorithm. Xz = Compression(archive.Xz) // Xz is xz compression algorithm. Zstd = Compression(archive.Zstd) // Zstd is zstd compression algorithm. )
Compressions types.
Variables ¶
This section is empty.
Functions ¶
func Tar ¶
func Tar(src CopyInfo, dst CopyInfo, opts *TarOptions) (io.ReadCloser, error)
Tar creates an archive from the source.
func Untar ¶
func Untar(content io.ReadCloser, dstPath string, opts *TarOptions) error
Untar reads a stream of bytes from `archive`, parses it as a tar archive, and unpacks it into the directory at `dest`. The archive may be compressed with one of the following algorithms: identity (uncompressed), gzip, bzip2, xz.
Types ¶
type Compression ¶
type Compression compression.Compression
Compression is the state represents if compressed or not.
type TarOptions ¶
type TarOptions struct {
IncludeFiles []string
ExcludePatterns []string
Compression Compression
RebaseNames map[string]string
SrcInfo CopyInfo
ChownOpts *ChownOpts
}
TarOptions wraps the tar options.
Click to show internal directories.
Click to hide internal directories.