zip

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetZipSize

func GetZipSize(
	pathToZip string,
) (int64, error)

Returns the size of the zip file at the given path. The path must be absolute.

Example:

("/home/dev/packer_1.7.4_windows_amd64.zip") -> 123456789, nil

func Unzip

func Unzip(
	pathToZip, pathToUnzip string,
	bytesUnzipped chan<- int,
) error

Unzips the zip file at the given path to the given destination path. Sends the number of bytes unzipped to the given channel.

Example:

("/home/dev/packer_1.7.4_windows_amd64.zip", "/home/dev/unzip", bytesUnzippedChan) -> nil

func UnzipFile added in v0.1.1

func UnzipFile(
	zf *zip.File,
	extractToPath string,
) (int64, error)

Unzips a file from a zip file to a destination path. The destination path is created if it doesn't exist. Returns the number of bytes copied.

Example:

(zipFile, "/home/dev/unzip") -> 1234, nil

Types

This section is empty.

Jump to

Keyboard shortcuts

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