zip

package
v3.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

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

func Extract(source io.ReaderAt, length int64, target string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL