Documentation ¶
Overview ¶
Package zip contains an implementation of a zip extractor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrorDangerousFilename indicates that a dangerous filename was found. ErrorDangerousFilename = errors.New("dangerous filename detected") // ErrorSizeMismatch indicates that the uncompressed size was unexpected. ErrorSizeMismatch = errors.New("mismatch between offered and actual size") // ErrorFileCountMismatch indicates that the file count was unexpected. ErrorFileCountMismatch = errors.New("mismatch between offered and actual file count") )
Functions ¶
func Extract ¶
Extract takes a reader and the length and then extracts it to the target. The target should be the path to a folder where the extracted files can be placed.
func ExtractSafe ¶ added in v3.5.0
func ExtractSafe(source io.ReaderAt, length int64, target string, uncompressedBytes int64, files int) error
ExtractSafe works like Extract() but verifies that the uncompressed size and file count are as expected. This can only be used if you know the file count and uncompressed size before extracting.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.