Documentation ¶
Index ¶
- Variables
- func AddFileToZip(dstZipFile string, entryName string, src io.Reader, opts ...AddFileToZipOption) error
- func UnzipFile(srcZipFilePath, dstDir string, opts ...UnzipFileOption) (paths []string, err error)
- func ZipDir(dst io.Writer, srcDir string, opts ...ZipDirOption) error
- type AddFileToZipOption
- type UnzipFileOption
- type ZipDirOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDoNotUnzipAFileAtRiskOfZipSlip = errors.New("zipz: do not unzip a file at risk of zip slip")
Functions ¶
func AddFileToZip ¶ added in v0.0.52
func AddFileToZip(dstZipFile string, entryName string, src io.Reader, opts ...AddFileToZipOption) error
AddFileToZip is a function to add a file to an existing zip file.
For Decompression Bomb protection, files larger than the size limit will cause an error using io.LimitReader. If a value less than or equal to 0 is specified for decompressionBombLimit, no Decompression Bomb protection will be performed.
Types ¶
type AddFileToZipOption ¶ added in v0.0.52
type AddFileToZipOption interface {
// contains filtered or unexported methods
}
func AddFileToZipWithDecompressionBombLimit ¶ added in v0.0.52
func AddFileToZipWithDecompressionBombLimit(decompressionBombLimit int64) AddFileToZipOption
type UnzipFileOption ¶
type UnzipFileOption interface {
// contains filtered or unexported methods
}
func UnzipFileWithFileInZipHandler ¶
func UnzipFileWithFileInZipHandler(f func(zipfile *zip.File, dstDir string) error) UnzipFileOption
type ZipDirOption ¶
type ZipDirOption interface {
// contains filtered or unexported methods
}
func ZipDirWithPathInZipHandler ¶
func ZipDirWithPathInZipHandler(f func(path string) string) ZipDirOption
func ZipDirWithWalkHandler ¶
Click to show internal directories.
Click to hide internal directories.