tar

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(tarFilePath, tarContentsPath string, excludes ...*regexp.Regexp) error

Compress the provided `tarContentsPath` into the `tarFilePath` while excluding the `exclude` regular expression patterns. This function will preserve path between `tarFilePath` and `tarContentsPath` directories inside the archive (see `CompressWithoutPreservingPath` as an alternative).

func CompressWithoutPreservingPath added in v0.7.5

func CompressWithoutPreservingPath(tarFilePath, tarContentsPath string, excludes ...*regexp.Regexp) error

Compress the provided `tarContentsPath` into the `tarFilePath` while excluding the `exclude` regular expression patterns. This function will not preserve path leading to the `tarContentsPath` directory in the archive.

func Extract

func Extract(tarFilePath, destinationPath string) error

Extract can be used to extract the provided `tarFilePath` into the `destinationPath`.

func ReadFileFromGzippedTar

func ReadFileFromGzippedTar(
	tarPath, filePath string,
) (res io.Reader, err error)

ReadFileFromGzippedTar opens a tarball and reads contents of a file inside.

func SanitizeArchivePath added in v0.7.6

func SanitizeArchivePath(d, t string) (v string, err error)

Sanitize archive file pathing from "G305: Zip Slip vulnerability" https://security.snyk.io/research/zip-slip-vulnerability

Types

This section is empty.

Jump to

Keyboard shortcuts

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