# README
go-unzip
一、这是什么?优势是什么?
Go中用来解压zip文件的API,优势:
- 在原生的zip.File的基础上封装了易用API,一键解压
- 支持并发解压zip文件
二、安装
go get -u github.com/compression-algorithm-research-lab/go-unzip
三、API示例
package main
import "github.com/compression-algorithm-research-lab/go-unzip"
func main() {
options := unzip.NewOptions().
SetSourceZipFile("test_data/foo.zip").
SetDestinationDirectory("test_data/foo").
SetWorkerNum(100)
err := unzip.New(options).Unzip()
if err != nil {
panic(err)
}
}
# Packages
No description provided by the author
# Functions
BuildZipSlipError 当检查到zip slip文件时,为其构造错误信息.
IsZipSlip 对单个文件进行zip slip检查 baseDirectory: 要解压到的目录 filename: 要解压的文件的名称.
New 从选项创建一个解压缩组件.
NewFile 从压缩文件创建文件.
No description provided by the author
# Constants
DefaultUnzipWorkerNum 如果没有指定的话,默认情况下解压使用的并发数是多少.
# Variables
ErrDestinationDirectoryEmpty 解压到的目录不能为空.
ErrSourceZipFileEmpty 源zip文件不能为空,否则会返回此错误.
ErrWorkerNumInvalid 解压zip文件时的并发数必须大于0,否则没法搞了.
# Type aliases
FileHandler 用来处理解压出来的文件.