# README
archive
A simple Go archiving library.
Example usage
package main
import (
"github.com/pkg6/archive"
"log"
"os"
)
func main() {
file, err := os.Create("file.zip")
if err != nil {
// deal with the error
}
zip, err := archive.New(file, "zip")
if err != nil {
log.Fatal(err)
}
defer zip.Close()
zip.Add(archive.File{
Destination: "file.txt",
Source: "/path/to/file.txt",
})
}
Support compression format
- tar.gz
- tgz
- tar
- gz
- tar.xz
- txz
- tar.zst
- tzst
- zip
# Functions
Copy copies the source archive into a new one, which can be appended at.
New archive.
NewGzip gz archive.
NewTar tar archive.
NewTarGz tar.gz archive.
NewTarXz tar.xz archive.
NewTarZst tar.zst archive.
NewZip zip archive.
TarCopy creates a new tar with the contents of the given tar.
No description provided by the author
No description provided by the author
# Interfaces
Archive represents a compression archive files from disk can be written to.