Documentation ¶
Index ¶
- func Compress(tarFilePath, tarContentsPath string, excludes ...*regexp.Regexp) error
- func CompressWithoutPreservingPath(tarFilePath, tarContentsPath string, excludes ...*regexp.Regexp) error
- func Extract(tarFilePath, destinationPath string) error
- func ReadFileFromGzippedTar(tarPath, filePath string) (res io.Reader, err error)
- func SanitizeArchivePath(d, t string) (v string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compress ¶
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 ¶
Extract can be used to extract the provided `tarFilePath` into the `destinationPath`.
func ReadFileFromGzippedTar ¶
ReadFileFromGzippedTar opens a tarball and reads contents of a file inside.
func SanitizeArchivePath ¶ added in v0.7.6
Sanitize archive file pathing from "G305: Zip Slip vulnerability" https://security.snyk.io/research/zip-slip-vulnerability
Types ¶
This section is empty.