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 WithAddFileToZipOptionDecompressionBombLimit ¶ added in v0.0.57
func WithAddFileToZipOptionDecompressionBombLimit(decompressionBombLimit int64) AddFileToZipOption
type UnzipFileOption ¶
type UnzipFileOption interface {
// contains filtered or unexported methods
}
func WithUnzipFileOptionFileInZipHandler ¶ added in v0.0.57
func WithUnzipFileOptionFileInZipHandler(f func(zipfile *zip.File, dstDir string) error) UnzipFileOption
type ZipDirOption ¶
type ZipDirOption interface {
// contains filtered or unexported methods
}
func WithZipDirOptionPathInZipHandlerFunc ¶ added in v0.0.57
func WithZipDirOptionPathInZipHandlerFunc(f func(path string) string) ZipDirOption
WithZipDirOptionPathInZipHandlerFunc is a function to specify the path in the zip file.
func WithZipDirOptionWalkFunc ¶ added in v0.0.57
Click to show internal directories.
Click to hide internal directories.