bzip2

package
v1.2.1 Latest Latest
Warning

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

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

Documentation

Overview

Package bzip2 implements an Expander for standalone bzip2 compressed files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bzip2Expander

type Bzip2Expander struct {
	expand.ExpandOptions
}

Bzip2Expander decompresses standalone bzip2 files (not tar.bz2). Its size limit comes from the embedded ExpandOptions (bzip2 is a single stream, so only MaxEntrySize applies): zero uses the default and a negative value disables the check, so a zero-value Bzip2Expander is safe rather than unlimited.

func NewBzip2Expander added in v1.2.1

func NewBzip2Expander(opts ...expand.Option) *Bzip2Expander

NewBzip2Expander returns a Bzip2Expander with a safe default size limit, overridable via options.

func (*Bzip2Expander) Expand

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

Expand decompresses a bzip2 file from src into the dst directory.

func (*Bzip2Expander) Matcher

func (b *Bzip2Expander) 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