archive

package
v6.0.1-0...-ae41ae8 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RunWrapper func(cmd *exec.Cmd, output string, allowedCmds []string) (func(), error)

RunWrapper is an optional function that's used to wrap rsync, useful for confinement like AppArmor.

Functions

func CompressedTarReader

func CompressedTarReader(ctx context.Context, r io.ReadSeeker, unpacker []string, outputPath string) (*tar.Reader, context.CancelFunc, error)

CompressedTarReader returns a tar reader from the supplied (optionally compressed) tarball stream. The unpacker arguments are those returned by DetectCompressionFile(). The returned cancelFunc should be called when finished with reader to clean up any resources used. This can be done before reading to the end of the tarball if desired.

This uses RunWrapper if set.

func DetectCompression

func DetectCompression(fname string) ([]string, string, []string, error)

DetectCompression detects compression from a file name.

func DetectCompressionFile

func DetectCompressionFile(f io.Reader) ([]string, string, []string, error)

DetectCompressionFile detects the compression type of a file and returns the tar arguments needed to unpack the file, compression type (in the form of a file extension), and the command needed to decompress the file to an uncompressed tarball.

func ExtractWithFds

func ExtractWithFds(cmdName string, args []string, allowedCmds []string, stdin io.ReadCloser, output *os.File) error

ExtractWithFds runs extractor process under specifc AppArmor profile. The allowedCmds argument specify commands which are allowed to run by apparmor. The cmd argument is automatically added to allowedCmds slice.

This uses RunWrapper if set.

func Unpack

func Unpack(file string, path string, blockBackend bool, maxMemory int64, tracker *ioprogress.ProgressTracker) error

Unpack extracts image from archive.

Types

This section is empty.

Jump to

Keyboard shortcuts

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