tar

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: 12 Imported by: 0

Documentation

Overview

Package tar implements an Expander for tar archives, including gzip and bzip2 compressed variants.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TarExpander

type TarExpander struct {
	expand.ExpandOptions
}

TarExpander extracts tar, tar.gz, and tar.bz2 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 TarExpander is safe, not unlimited.

func NewTarExpander added in v1.2.1

func NewTarExpander(opts ...expand.Option) *TarExpander

NewTarExpander returns a TarExpander with safe default resource limits, overridable via options.

func (*TarExpander) Expand

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

Expand extracts a tar archive from src into the dst directory.

func (*TarExpander) Matcher

func (t *TarExpander) Matcher(fileName string) bool

Matcher returns true if the file name contains a tar-related extension.

Jump to

Keyboard shortcuts

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