files

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateZipArchive

func CreateZipArchive(files []string, buf io.Writer) error

func GZip

func GZip(files []string, outputTarFilename string) error

Create .tar.gz archive for files. Write output to outputZipFilename.

func GZipDecompress

func GZipDecompress(filePath, outputDir string) error

GZipDecompress decompresses a .tar.gz file to a specified output directory

func GetAllFiles

func GetAllFiles(localPath string, skip ...string) ([]string, error)

Returns all the files in the directory. Recurses to find all the paths in parallel using walkman module. skip: names of files to ignore e.g .git, .env etc

func GetRelativePath

func GetRelativePath(file string, baseDir string) string

GetRelativePaths returns a file path with the given base directory removed and the directory name of the base directory added to the start of each path. It takes a path to a file and a base directory as input parameters. The function removes the base directory from each file path in the input slice, and removes the leading path separator if any. Then it joins the directory name of the base directory and the relative path using `filepath.Join`, and finally returns the new relative file path.

func UnZip

func UnZip(zipFileName string, destDir string) error

func Zip

func Zip(files []string, outputZipFilename string) error

Create .zip archive for files. Write output to outputZipFilename.

Types

This section is empty.

Jump to

Keyboard shortcuts

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