Documentation ¶
Index ¶
- Variables
- func CompressedTarReader(ctx context.Context, r io.ReadSeeker, unpacker []string, outputPath string) (*tar.Reader, context.CancelFunc, error)
- func DetectCompression(fname string) ([]string, string, []string, error)
- func DetectCompressionFile(f io.Reader) ([]string, string, []string, error)
- func ExtractWithFds(cmdName string, args []string, allowedCmds []string, stdin io.ReadCloser, ...) error
- func Unpack(file string, path string, blockBackend bool, maxMemory int64, ...) error
Constants ¶
This section is empty.
Variables ¶
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 ¶
DetectCompression detects compression from a file name.
func DetectCompressionFile ¶
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.