Documentation ¶
Overview ¶
Package archiver makes it super easy to create .zip and .tar.gz archives.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CompressedFormats = map[string]struct{}{
".7z": {},
".avi": {},
".bz2": {},
".gif": {},
".gz": {},
".jpeg": {},
".jpg": {},
".lz": {},
".lzma": {},
".mov": {},
".mp3": {},
".mp4": {},
".mpeg": {},
".mpg": {},
".png": {},
".rar": {},
".xz": {},
".zip": {},
".zipx": {},
}
CompressedFormats is a set of lowercased file extensions for file formats that are typically already compressed. Compressing already-compressed files often results in a larger file. This list is not an exhaustive.
Functions ¶
func TarGz ¶
TarGz creates a .tar.gz file at targzPath containing the contents of files listed in filePaths. File paths can be those of regular files or directories. Regular files are stored at the 'root' of the archive, and directories are recursively added.
func Zip ¶
Zip creates a .zip file in the location zipPath containing the contents of files listed in filePaths. File paths can be those of regular files or directories. Regular files are stored at the 'root' of the archive, and directories are recursively added.
Files with an extension for formats that are already compressed will be stored only, not compressed.
Types ¶
type CompressFunc ¶
CompressFunc is a function that makes an archive.
type DecompressFunc ¶
DecompressFunc is a function that extracts an archive.