archive

package
v1.21.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadAndExtractTarball added in v1.19.0

func DownloadAndExtractTarball(url string, removeTopLevel bool) (string, func(), error)

DownloadAndExtractTarball takes an url to a tar.gz file and extracts into a new a temp directory and the directory and a cleanup function. It's the caller's responsibility to call the cleanup function.

func ExtractTarballWithCleanup added in v1.19.0

func ExtractTarballWithCleanup(tarball string, removeTopLevel bool) (string, func(), error)

ExtractTarballWithCleanup takes a tarball file and extracts it into a temp directory Caller is responsible for cleanup of the temp directory using the returned cleanup function. If removeTopLevel is true, the top level directory will be removed.

func Tar added in v1.16.0

func Tar(src string, tarballFilePath string, exclusion string) error

Tar takes a source dir and tarballFilePath and a single exclusion path It creates a gzipped tarball. So sorry that exclusion is a single relative path. It should be a set of patterns, rfay 2021-12-15

func UnBzip2 added in v1.19.1

func UnBzip2(source string, destDirectory string) error

UnBzip2 accepts a bzip2-compressed file and uncompresses it to the provided destination directory.

func UnXz added in v1.19.1

func UnXz(source string, destDirectory string) error

UnXz accepts an xz-compressed file and uncompresses it to the provided destination directory.

func Ungzip

func Ungzip(source string, destDirectory string) error

Ungzip accepts a gzipped file and uncompresses it to the provided destination directory.

func Untar

func Untar(source string, dest string, extractionDir string) error

Untar accepts a tar, tar.gz, tar.bz2, tar.xz file and extracts the contents to the provided destination path. extractionDir is the path at which extraction should start; nothing will be extracted except the contents of extractionDir. If extranctionDir is empty, the entire tarball is extracted.

func Unzip

func Unzip(source string, dest string, extractionDir string) error

Unzip accepts a zip file and extracts the contents to the provided destination path. extractionDir is the path at which extraction should szipt; nothing will be extracted except the contents of extractionDir

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL