Documentation ¶
Overview ¶
Package compactor provides Tar/Gzip and Zip archive utilities with optional checksum computation.
Index ¶
- func CreateTarball(basePath string, src string, dst string) error
- func CreateTarballWithChecksum(basePath string, src string, dst string, checksumAlgo string, ...) (string, error)
- func CreateZipball(basePath string, src string, dst string) error
- func CreateZipballWithChecksum(basePath, src string, dst string, checksumAlgo string, checksumDst string) (string, error)
- type ArchiveFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTarball ¶
CreateTarball archives and compresses a file or folder (src) using Tar/Gzip to dst (tarball). basePath param specify the base path directory of src path which will be skipped for each archive file header. Otherwise if basePath param is empty then only src path will taken into account.
func CreateTarballWithChecksum ¶
func CreateTarballWithChecksum(basePath string, src string, dst string, checksumAlgo string, checksumDst string) (string, error)
CreateTarballWithChecksum archives and compresses a file or folder (src) using Tar/Gzip to dst (tarball) with checksum (`md5`, `sha1`, `sha256` or `sha512`). It returns the checksum file path or an error. basePath param specify the base path directory of src path which will be skipped for each archive file header. Otherwise if basePath param is empty then only src path will taken into account.
func CreateZipball ¶
CreateZipball archives and compresses a file or folder (src) using Zip to dst (zipball). basePath param specify the base path directory of src path which will be skipped for each archive file header. Otherwise if basePath param is empty then only src path will taken into account.
func CreateZipballWithChecksum ¶
func CreateZipballWithChecksum(basePath, src string, dst string, checksumAlgo string, checksumDst string) (string, error)
CreateZipballWithChecksum archives and compresses a file or folder (src) using Zip to dst (Zipball) with checksum (`md5`, `sha1`, `sha256` or `sha512`). It returns the checksum file path or an error. basePath param specify the base path directory of src path which will be skipped for each archive file header. Otherwise if basePath param is empty then only src path will taken into account.
Types ¶
type ArchiveFormat ¶
type ArchiveFormat uint8
ArchiveFormat represents the archive output format.
const ( // ArchiveFormatTar represents the Tar/Gzip output format. ArchiveFormatTar ArchiveFormat = iota // ArchiveFormatZip represents the Zip output format. ArchiveFormatZip )
Directories ¶
Path | Synopsis |
---|---|
pkg
|
|
archive
Package archive provides archiving and files compressing using Tar-GZ or Zip formmat.
|
Package archive provides archiving and files compressing using Tar-GZ or Zip formmat. |
checksum
Package checksum provides checksum computation for files using md5, sha1, sha256 and sha512 algorithms.
|
Package checksum provides checksum computation for files using md5, sha1, sha256 and sha512 algorithms. |