archive

package
v0.0.0-...-4df811a Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const DRY_RUN = 1

Variables

This section is empty.

Functions

func Archive

func Archive(source, target string) (err error)

Creates a .tar.gz archive. `source` is a path to a directory to archive. `target` is a path to the target `.tar.gz` file

func ArchiveWithPassphrase

func ArchiveWithPassphrase(source, target, passphrase string) (err error)

Creates a `.tar.gz` archive of the `source` directory, into the `traget` file, and encrypts it using `passphrase`

func Extract

func Extract(archive io.Reader, target string) (err error)

Extracts the contents of a tar.gz archive into the `target` directory

func ExtractWithPassphrase

func ExtractWithPassphrase(archivepath, target, passphrase string, flag int) (err error)

Decrypts and extracts an archive using a passphrase. `archivepath` is the path to the encrypted archive, `target` is the directory where the archive will be extracted, and `passphrase` is the passphrase used to decrypt.

func GetBackupPath

func GetBackupPath(wd, projectName, backupName string) string

GetBackupPath returns the path to file the backup archive will be written to

func Gzip

func Gzip(reader io.Reader) (_ io.Reader, err error)

Gzip compresses data with the gzip algorithm.

func Tar

func Tar(source string) (_ io.ReadWriter, err error)

Tar creates a tar archive source is a path to a directory to archive

func TarFileList

func TarFileList(fileList []utils.FileInfo) (_ io.ReadWriter, err error)

TarFileList function creates a tar archive from a list of files. the `fileList` may be optained through `utils.DirWalk()` target is the path to the output tarball, without the file extension

func UnGzip

func UnGzip(source io.Reader) (io.Reader, error)

UnGzip uncompresses gzipped data

func Untar

func Untar(tarball io.Reader, target string) error

Untar extracts content from a tar archive. `target` is the path to a directory to write the extracted files to

Types

This section is empty.

Jump to

Keyboard shortcuts

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