Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidFormat = errors.New("unsupported archive format") ErrZipUnarchiveNotPossible = errors.New("zip unarchive must conform to io.Seeker and io.ReaderAt") )
Functions ¶
func CreateFromPath ¶
CreateFromPath uses the contents at the source path and creates a new archive at the target path.
func CreateToWriter ¶
CreateToWriter creates a new archive based on the given source and extention. The output is written to the writer that is passed.
func ExtractFromPath ¶
ExtractFromPath extracts the archive at the source path to the target path.
func ExtractFromReader ¶
ExtractFromReader takes a source reader, a path to save the archive at and a format to select archive and compression type. Note that .zip files requires the reader to conform to both io.Seeker and io.ReaderAt to work.
Types ¶
type Format ¶
type Format = string
const ( Zip Format = ".zip" // Zip file extension for a regular zip archive. Tar Format = ".tar" // Tar file extension for a regular tar archive. // Long versions (two extensions) of compressed tar archive formats. TarBzip2 Format = ".tar.bz2" // TarBzip2 file extension for bzip2 compressed tar archive. TarGzip Format = ".tar.gz" // TarGzip file extension for gzip compressed tar archive. TarXz Format = ".tar.xz" // TarXz file extension for xz compressed tar archive. TarZstd Format = ".tar.zst" // TarZstd file extension for zstd compressed tar archive. // Short versions (one extension) of compressed tar archive formats. TarBzip2Short Format = ".tbz2" // TarBzip2 file extension for bzip2 compressed tar archive. TarGzipShort Format = ".tgz" // TarGzip file extension for gzip compressed tar archive. TarXzShort Format = ".txz" // TarXz file extension for xz compressed tar archive. TarZstdShort Format = ".tzst" // TarZstd file extension for zstd compressed tar archive. )
Click to show internal directories.
Click to hide internal directories.