archive

package
v1.21.6 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 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.21.5

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.21.5

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.21.5

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.21.5

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.21.5

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