README
¶
Targz
Library for packaging/extracting folders in tar.gz archives.
Installation
Installing using go get is the easiest.
go get github.com/walle/targz
Usage
The API is really simple, there are only two methods.
- Compress
- Extract
Create an archive containing a folder
import "github.com/walle/targz"
...
err := targz.Compress("my_folder", "my_file.tar.gz")
Extract an archive
import "github.com/walle/targz"
...
err := targz.Extract("my_file.tar.gz", "path/to/extract/to")
Contributing
All contributions are welcome! See CONTRIBUTING for more info.
License
Licensed under MIT license. See LICENSE for more information.
Documentation
¶
Overview ¶
Package targz contains methods to create and extract tar gz archives.
Usage (discarding potential errors):
targz.Compress("path/to/the/directory/to/compress", "my_archive.tar.gz") targz.Extract("my_archive.tar.gz", "directory/to/extract/to")
This creates an archive in ./my_archive.tar.gz with the folder "compress" (last in the path). And extracts the folder "compress" to "directory/to/extract/to/". The folder structure is created if it doesn't exist.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compress ¶
Compress creates an archive from the folder inputFilePath points to in the file outputFilePath points to. Only adds the last directory in inputFilePath to the archive, not the whole path. It tries to create the directory structure outputFilePath contains if it doesn't exist. It returns potential errors to be checked or nil if everything works.
Types ¶
This section is empty.