Documentation ¶
Index ¶
- func ApplyLayer(dest string, layer archive.ArchiveReader) (size int64, err error)
- func ApplyUncompressedLayer(dest string, layer archive.ArchiveReader) (int64, error)
- func CopyFileWithTar(src, dst string) (err error)
- func CopyWithTar(src, dst string) error
- func TarUntar(src, dst string) error
- func Untar(tarArchive io.Reader, dest string, options *archive.TarOptions) error
- func UntarPath(src, dst string) error
- func UntarUncompressed(tarArchive io.Reader, dest string, options *archive.TarOptions) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyLayer ¶
func ApplyLayer(dest string, layer archive.ArchiveReader) (size int64, err error)
ApplyLayer parses a diff in the standard layer format from `layer`, and applies it to the directory `dest`. The stream `layer` can only be uncompressed. Returns the size in bytes of the contents of the layer.
func ApplyUncompressedLayer ¶ added in v1.8.0
func ApplyUncompressedLayer(dest string, layer archive.ArchiveReader) (int64, error)
ApplyUncompressedLayer parses a diff in the standard layer format from `layer`, and applies it to the directory `dest`. The stream `layer` can only be uncompressed. Returns the size in bytes of the contents of the layer.
func CopyFileWithTar ¶
CopyFileWithTar emulates the behavior of the 'cp' command-line for a single file. It copies a regular file from path `src` to path `dst`, and preserves all its metadata.
If `dst` ends with a trailing slash '/' ('\' on Windows), the final destination path will be `dst/base(src)` or `dst\base(src)`
func CopyWithTar ¶
CopyWithTar creates a tar archive of filesystem path `src`, and unpacks it at filesystem path `dst`. The archive is streamed directly with fixed buffering and no intermediary disk IO.
func TarUntar ¶
TarUntar is a convenience function which calls Tar and Untar, with the output of one piped into the other. If either Tar or Untar fails, TarUntar aborts and returns the error.
func Untar ¶
Untar reads a stream of bytes from `archive`, parses it as a tar archive, and unpacks it into the directory at `dest`. The archive may be compressed with one of the following algorithms:
identity (uncompressed), gzip, bzip2, xz.
func UntarPath ¶
UntarPath is a convenience function which looks for an archive at filesystem path `src`, and unpacks it at `dst`.
func UntarUncompressed ¶ added in v1.8.0
UntarUncompressed reads a stream of bytes from `archive`, parses it as a tar archive, and unpacks it into the directory at `dest`. The archive must be an uncompressed stream.
Types ¶
This section is empty.