zip

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package zip implements an Expander for ZIP archives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZipExpander

type ZipExpander struct {
	expand.ExpandOptions
}

ZipExpander provides functionality to extract ZIP archives. Its limits come from the embedded ExpandOptions: each zero value uses the default and a negative value disables the check, so a zero-value ZipExpander is safe.

func NewZipExpander added in v1.2.1

func NewZipExpander(opts ...expand.Option) *ZipExpander

NewZipExpander returns a ZipExpander with safe default resource limits, overridable via options.

func (*ZipExpander) Expand

func (z *ZipExpander) Expand(ctx context.Context, src, dst string, umask os.FileMode) (err error)

Expand extracts a ZIP file to the specified destination directory. It handles tilde expansion, enforces file size limits, and ensures secure extraction.

func (*ZipExpander) Matcher

func (z *ZipExpander) Matcher(extension string) bool

Matcher checks if the extension matches supported formats.

Jump to

Keyboard shortcuts

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