Documentation ¶
Overview ¶
Package archiver makes it super easy to create and open .zip, .tar.gz, and .tar.bz2 files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Rar rarFormat
Rar is for RAR archive format
View Source
var SupportedFormats = map[string]Archiver{}
SupportedFormats contains all supported archive formats
View Source
var Tar tarFormat
Tar is for Tar format
View Source
var TarBz2 tarBz2Format
TarBz2 is for TarBz2 format
View Source
var TarGz tarGzFormat
TarGz is for TarGz format
View Source
var TarLz4 tarLz4Format
TarLz4 is for TarLz4 format
View Source
var TarSz tarSzFormat
TarSz is for TarSz format
View Source
var TarXZ xzFormat
TarXZ is for TarXZ format
View Source
var Zip zipFormat
Zip is for Zip format
Functions ¶
func RegisterFormat ¶
RegisterFormat adds a supported archive format
Types ¶
type Archiver ¶
type Archiver interface { // Match checks supported files Match(filename string) bool // Make makes an archive file on disk. Make(destination string, sources []string) error // Open extracts an archive file on disk. Open(source, destination string) error // Write writes an archive to a Writer. Write(output io.Writer, sources []string) error // Read reads an archive from a Reader. Read(input io.Reader, destination string) error }
Archiver represent a archive format
func MatchingFormat ¶
MatchingFormat returns the first archive format that matches the given file, or nil if there is no match
type PreservableArchiver ¶
type PreservableArchiver interface { // Match checks supported files Match(filename string) bool // Make makes an archive file on disk. Make(destination string, sources []string) error // Open extracts an archive file on disk. Open(source, destination string) error // Write writes an archive to a Writer. Write(output io.Writer, sources []string) error // Read reads an archive from a Reader. Read(input io.Reader, destination string) error // Open extracts an archive file on disk while preserving uid/gid. OpenPreserve(source, destination string) error // Read reads an archive from a Reader while preserving uid/gid. ReadPreserve(input io.Reader, destination string) error }
PreservableArchiver represent a archive format
Source Files ¶
Click to show internal directories.
Click to hide internal directories.