zip

package
v0.0.0-...-f1279a5 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2019 License: MIT Imports: 11 Imported by: 0

README

压缩文件

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Unzip_InputTypeErr = "input必须是一个文件"
View Source
var Unzip_InputZipErr = "input不是zip文件或文件已经损坏"
View Source
var Unzip_MakeDirErr = "创建文件夹失败"
View Source
var Zip_FileModeErr = "文件的filemod不一致"

Functions

func Unzip

func Unzip(input, output string) ([]string, error)

解压文件

func Zip

func Zip(files []*ZipFileStruct, out string) error

func ZipDir

func ZipDir(path string, skipempty bool, out ...string) error

func ZipInfo

func ZipInfo(filepath string) ([]fileInfo, error)

压缩文件信息

Types

type ZipFileStruct

type ZipFileStruct struct {
	FilePath        string                              //需要压缩的文件地址
	ZipPath         string                              //zip文件的地址
	FileMode        os.FileMode                         //文件类型
	ModTime         time.Time                           //
	StreamTransform func(string) (io.ReadCloser, error) //转换读写流
}

func (*ZipFileStruct) Reader

func (zfs *ZipFileStruct) Reader() (io.ReadCloser, error)

Jump to

Keyboard shortcuts

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