Utilities to help creating tarballs, untar, gzip and ungzip.
Creates a tarball from a source file or directory and returns a *bytes.Buffer
.
tarBuf, err := NewTarballBuffer("/tmp/foobar")
if != err {
// handle error
}
Receives a tar wrapped in an io.Reader
and unarchives it to a determined path.
err := UntarToFile(tarBuf, "/tmp")
if != err {
// handle error
}
Creates a new Gzip from an io.Reader
and returns a *bytes.Buffer
.
gzipBuf, err := NewGzipBuffer(tarBuf)
if != err {
// handle error
}
Receives a Gzip wrapped in an io.Reader
and returns a *bytes.Buffer
.
ungzipBuf, err := UngzipToBuffer(gzipBuf)
if != err {
// handle error
}
Stephano Zanzin [email protected]
Please, refer to the LICENSE file.