repositorypackage
0.2.0
Repository: https://github.com/joseluisq/compactor.git
Documentation: pkg.go.dev
# README
Compactor

Tar/Gzip and Zip archive utilities with optional checksum computation.
Usage
Tar/Gzip
package main
import (
"github.com/joseluisq/compactor"
)
func main() {
compactor.CreateTarballWithChecksum(
// 1. a base input path directory (it will be skipped for each archive header)
"./my-base-dir",
// 2. archive input file or directory
"./my-file-or-dir",
// 3. archive output file
"~/my-archive.tar.gz",
// 4. checksum algorithm
"sha256",
// 5. checksum output file
"~/my-archive.CHECKSUM.txt",
)
// output files:
// ~/my-archive.tar.gz
// ~/my-archive.sha256.tar.txt
}
Zip
package main
import (
"github.com/joseluisq/compactor"
)
func main() {
compactor.CreateZipballWithChecksum(
// 1. a base input path directory (it will be skipped for each archive header)
"./my-base-dir",
// 2. archive input file or directory
"./my-file-or-dir",
// 3. archive output file
"~/my-archive.zip",
// 4. checksum algorithm
"sha256",
// 5. checksum output file
"~/my-archive.CHECKSUM.zip.txt",
)
// output files:
// ~/my-archive.zip
// ~/my-archive.sha256.zip.txt
}
For more API functionalities take a look at https://pkg.go.dev/github.com/joseluisq/compactor
Contributions
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in current work by you, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.
Feel free to send some Pull request or issue.
License
This work is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
© 2020-present Jose Quintana