Documentation
¶
Overview ¶
Package ziplib provides core zip/unzip functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unzip ¶
func Unzip(zipPath string, opts UnzipOptions) error
Unzip extracts the contents of a zip archive.
Types ¶
type ListEntry ¶
type ListEntry struct {
Name string
UncompressedSize uint64
CompressedSize uint64
Modified time.Time
IsDir bool
}
ListEntry holds metadata about a single entry in a zip archive.
type UnzipOptions ¶
type UnzipOptions struct {
// OutputDir is the directory to extract files into. Defaults to ".".
OutputDir string
// Overwrite allows overwriting existing files.
Overwrite bool
// JunkPaths strips directory components from file names on extraction.
JunkPaths bool
// FilePatterns filters which files to extract. Empty means extract all.
FilePatterns []string
// Output is where status messages are written. If nil, messages are discarded.
Output io.Writer
}
UnzipOptions configures the behavior of the Unzip function.
type ZipOptions ¶
type ZipOptions struct {
// Recursive enables recursive directory traversal.
Recursive bool
// CompressionLevel sets the flate compression level (0-9).
// -1 means default compression.
CompressionLevel int
// ExcludePatterns is a list of glob patterns to exclude from the archive.
ExcludePatterns []string
// Output is where status messages are written. If nil, messages are discarded.
Output io.Writer
}
ZipOptions configures the behavior of the Zip function.
Click to show internal directories.
Click to hide internal directories.