zipKit

package
v3.0.26 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ZipByCyan 压缩文件(或目录)
	/*
	   PS:
	   (1) 缺点: 第三方库dablelv/go-huge-util暂不支持带密码的压缩.
	   (2) 如果 zipPath 对应的是一个已经存在的文件,将会"覆盖"该文件的内容;
	   	如果 zipPath 对应的是一个已经存在的目录,将会返回error(open {path}: is a directory).

	   @param zipPath 	e.g."archive.zip"
	   @param paths	多个文件(或目录)的路径
	*/
	ZipByCyan func(zipPath string, paths ...string) error = zip.Zip

	// UnzipByCyan 解压
	/*
	   @param zipPath e.g."archive.zip"
	*/
	UnzipByCyan func(zipPath, dstDir string) error = zip.Unzip
)
View Source
var (
	// Zip zip压缩文件.
	/*
		@param path 可以是 文件 || 目录
	*/
	Zip func(path string, destPath string) error = fileutil.Zip

	// UnZip zip解压缩文件并保存在目录中.
	UnZip func(zipFile string, destPath string) error = fileutil.UnZip

	// ZipAppendEntry 通过将单个文件或目录追加到现有的zip文件.
	ZipAppendEntry func(fpath string, destPath string) error = fileutil.ZipAppendEntry

	// IsZipFile 判断文件是否是zip压缩文件.
	IsZipFile func(filepath string) bool = fileutil.IsZipFile
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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