Versions in this module Expand all Collapse all v0 v0.0.1 Dec 11, 2023 Changes in this version + const DefaultUnzipWorkerNum + var ErrDestinationDirectoryEmpty = errors.New("options.DestinationDirectory can not empty") + var ErrSourceZipFileEmpty = errors.New("options.SourceZipFile can not empty") + var ErrWorkerNumInvalid = errors.New("options.WorkerNum it has to be greater than 0") + func BuildZipSlipError(file *zip.File) error + func IsZipSlip(baseDirectory, filename string) bool + type File struct + func NewFile(zipFile *zip.File) *File + func (x *File) ReadBytes() (bytes []byte, returnError error) + func (x *File) SafeUnzip(baseDirectory string) (err error) + func (x *File) Save(path string) (err error) + func (x *File) Unzip(baseDirectory string) (err error) + type FileHandler func(file *File, options *Options) error + type Options struct + DestinationDirectory string + SourceZipFile string + WorkerNum *int + func NewOptions() *Options + func (x *Options) SetDestinationDirectory(destinationDirectory string) *Options + func (x *Options) SetSourceZipFile(sourceZipFile string) *Options + func (x *Options) SetWorkerNum(workerNum int) *Options + type Unzip struct + func New(options *Options) *Unzip + func (x *Unzip) Files() (fileSlice []*File, err error) + func (x *Unzip) SafeTraversal(handler FileHandler) (err error) + func (x *Unzip) Traversal(handler FileHandler) (err error) + func (x *Unzip) Unzip() error