Documentation
¶
Index ¶
- Variables
- func Archive(dir, outfile string, compression archives.Compression, ...) error
- func ArchiveWithFilter(dir, outfile string, compression archives.Compression, ...) error
- func Compress(data []byte, compression archives.Compression) ([]byte, error)
- func CompressBz2(data []byte) ([]byte, error)
- func CompressXz(data []byte) ([]byte, error)
- func Decompress(data []byte, compression archives.Compression) ([]byte, error)
- func DecompressBz2(data []byte) ([]byte, error)
- func DecompressXz(data []byte) ([]byte, error)
- func ExcludeFilesFilter(excludePatterns []string) (func(string) bool, error)
- func IncludeFilesFilter(includePatterns []string) (func(string) bool, error)
- func Unarchive(tarball, dst string) error
Constants ¶
This section is empty.
Variables ¶
var ArchivalMap = map[string]archives.Archival{ "tar": archives.Tar{}, "zip": archives.Zip{}, }
var CompressionMap = map[string]archives.Compression{ "gz": archives.Gz{}, "bz2": archives.Bz2{}, "xz": archives.Xz{}, "zst": archives.Zstd{}, "lz4": archives.Lz4{}, "br": archives.Brotli{}, }
Maps to handle compression and archival types
var DEBUG = os.Getenv("ARC_DEBUG") == "true"
Functions ¶
func Archive ¶
func Archive(dir, outfile string, compression archives.Compression, archival archives.Archival) error
Archive is a function that archives the files in a directory dir: the directory to Archive outfile: the output file compression: the compression to use (gzip, bzip2, etc.) archival: the archival to use (tar, zip, etc.)
func ArchiveWithFilter ¶ added in v1.1.0
func ArchiveWithFilter(dir, outfile string, compression archives.Compression, archival archives.Archival, filter func(string) bool) error
ArchiveWithFilter is a function that archives the files in a directory while excluding certain files based on a filter dir: the directory to Archive outfile: the output file compression: the compression to use (gzip, bzip2, etc.) archival: the archival to use (tar, zip, etc.) filter: a function that returns true for files to be excluded
func Compress ¶
func Compress(data []byte, compression archives.Compression) ([]byte, error)
Compress compresses input data using specified compressor.
func CompressBz2 ¶
CompressBz2 compresses input data using BZ2 compressor.
func CompressXz ¶
CompressXz compresses input data using XZ compressor.
func Decompress ¶
func Decompress(data []byte, compression archives.Compression) ([]byte, error)
Decompress decompresses input compressed data.
func DecompressBz2 ¶
DecompressBz2 decompresses input compressed data using BZ2 decompressor.
func DecompressXz ¶
DecompressXz decompresses input compressed data using XZ decompressor.
func ExcludeFilesFilter ¶ added in v1.1.0
ExcludeFilesFilter returns a filter function that excludes files matching the given regex patterns
func IncludeFilesFilter ¶ added in v1.1.0
IncludeFilesFilter returns a filter function that includes only files matching the given regex patterns
Types ¶
This section is empty.