archive

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: ISC Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Selector

type Selector func(string) (string, bool)

Selector is a function for selecting and projecting a directory or file. If a selector function returns true, the directory or file will be extracted. The selector function can also maps the give path to a new path when extracting.

type TarArchive

type TarArchive struct {
	// contains filtered or unexported fields
}

TarArchive facilitates working with tar.gz files.

func NewTarArchive

func NewTarArchive(ui ui.UI) *TarArchive

NewTarArchive creates a new instance of TarArchive.

func (*TarArchive) Extract

func (a *TarArchive) Extract(dest string, r io.Reader, f Selector) error

Extract traverses all directories and files in a tar.gz archive and uses a selector function to extract directories and files. dest is the path for extracing the directories and files into.

Jump to

Keyboard shortcuts

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