archive

package
v0.64.5 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package archive expands zip, tar, gzip, and bzip2 payloads into leaf entries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LooksLikeArchive

func LooksLikeArchive(data []byte) bool

Types

type Entry

type Entry struct {
	Path string
	Data []byte
}

Entry is one expanded file from inside an archive.

func Walk

func Walk(rootName string, data []byte, limits Limits) ([]Entry, error)

Walk expands data into a flat list of inner entries.

func WalkContext added in v0.61.0

func WalkContext(ctx context.Context, rootName string, data []byte, limits Limits) ([]Entry, error)

WalkContext is Walk with cancellation and deadline enforcement.

type Limits

type Limits struct {
	MaxDepth         int
	MaxEntryBytes    int64
	MaxExpandedBytes int64
	MaxFiles         int
}

Limits cap archive expansion work.

type PartialError added in v0.61.0

type PartialError struct {
	Kind, Entry string
	Err         error
}

PartialError identifies incomplete archive coverage while allowing callers to scan entries successfully extracted before or beside the failure.

func (*PartialError) Error added in v0.61.0

func (e *PartialError) Error() string

func (*PartialError) Unwrap added in v0.61.0

func (e *PartialError) Unwrap() error

Jump to

Keyboard shortcuts

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