tar

package module
v0.0.0-...-8a98f57 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor struct {
	Path     string
	Progress func(int64) int64

	// SanitizePathFunc can be provided if you wish to inspect and/or modify the source path
	// returning an error from this function will abort extraction
	SanitizePathFunc func(path string) (saferPath string, userDefined error)

	// LinkFunc can be provided for user specified handling of filesystem links
	// returning an error from this function aborts extraction
	LinkFunc func(Link) error
}

func (*Extractor) Extract

func (te *Extractor) Extract(reader io.Reader) error

func (*Extractor) Sanitize

func (te *Extractor) Sanitize(toggle bool)

Sanitize sets up the extractor to use built in sanitation functions (Modify paths to be platform legal, symlinks may not escape extraction root) or unsets any previously set sanitation functions on the extractor (no special rules are applied when extracting)

type Link struct {
	Root, Name, Target string
}

Link represents a filesystem link where Name is the link's destination path, Target is what the link actually points to, and Root is the extraction root

Jump to

Keyboard shortcuts

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