package
17.12.1-ce-rc2+incompatible
Repository: https://github.com/docker/docker-ce.git
Documentation: pkg.go.dev
# README
This code provides helper functions for dealing with archive files.
# Functions
ApplyLayer parses a diff in the standard layer format from `layer`, and applies it to the directory `dest`.
ApplyUncompressedLayer parses a diff in the standard layer format from `layer`, and applies it to the directory `dest`.
CanonicalTarNameForPath returns platform-specific filepath to canonical posix-style path for tar archival.
Changes walks the path rw and determines changes for the files in the path, with respect to the parent layers.
ChangesDirs compares two directories and generates an array of Change objects describing the changes.
ChangesSize calculates the size in bytes of the provided changes, based on newDir.
CompressStream compresses the dest with specified compression algorithm.
CopyInfoDestinationPath stats the given path to create a CopyInfo struct representing that resource for the destination of an archive copy operation.
CopyInfoSourcePath stats the given path to create a CopyInfo struct representing that resource for the source of an archive copy operation.
CopyResource performs an archive copy from the given source path to the given destination path.
CopyTo handles extracting the given content whose entries should be sourced from srcInfo to dstPath.
DecompressStream decompresses the archive and returns a ReaderCloser with the decompressed archive.
DetectCompression detects the compression algorithm of the source.
ExportChanges produces an Archive from the provided changes, relative to dir.
FileInfoHeader creates a populated Header from fi.
Generate generates a new archive from the content provided as input.
GetRebaseName normalizes and compares path and resolvedPath, return completed resolved path and rebased file name.
IsArchivePath checks if the (possibly compressed) file at the given path starts with a tar file header.
NewDefaultArchiver returns a new Archiver without any IDMappings.
NewTempArchive reads the content of src into a temporary file, and returns the contents of that file as an archive.
OverlayChanges walks the path rw and determines changes for the files in the path, with respect to the parent layers.
PrepareArchiveCopy prepares the given srcContent archive, which should contain the archived resource described by srcInfo, to the destination described by dstInfo.
PreserveTrailingDotOrSeparator returns the given cleaned path (after processing using any utility functions from the path or filepath stdlib packages) and appends a trailing `/.` or `/` if its corresponding original path (from before being processed by utility functions from the path or filepath stdlib packages) ends with a trailing `/.` or `/`.
ReadSecurityXattrToTarHeader reads security.capability xattr from filesystem to a tar header.
RebaseArchiveEntries rewrites the given srcContent archive replacing an occurrence of oldBase with newBase at the beginning of entry names.
ReplaceFileTarWrapper converts inputTarStream to a new tar stream.
ResolveHostSourcePath decides real path need to be copied with parameters such as whether to follow symbol link or not, if followLink is true, resolvedPath will return link target of any symbol link file, else it will only resolve symlink of directory but return symbol link file itself without resolving.
SplitPathDirEntry splits the given path between its directory name and its basename by first cleaning the path but preserves a trailing "." if the original path specified the current directory.
Tar creates an archive from the directory at `path`, and returns it as a stream of bytes.
TarResource archives the resource described by the given CopyInfo to a Tar archive.
TarResourceRebase is like TarResource but renames the first path element of items in the resulting tar archive to match the given rebaseName if not "".
TarResourceRebaseOpts does not preform the Tar, but instead just creates the rebase parameters to be sent to TarWithOptions (the TarOptions struct).
TarWithOptions creates an archive from the directory at `path`, only including files whose relative paths are included in `options.IncludeFiles` (if non-nil) or not in `options.ExcludePatterns`.
Unpack unpacks the decompressedArchive to dest with options.
UnpackLayer unpack `layer` to a `dest`.
Untar reads a stream of bytes from `archive`, parses it as a tar archive, and unpacks it into the directory at `dest`.
UntarUncompressed reads a stream of bytes from `archive`, parses it as a tar archive, and unpacks it into the directory at `dest`.
# Constants
AUFSWhiteoutFormat is the default format for whiteouts.
Bzip2 is bzip2 compression algorithm.
ChangeAdd represents the add operation.
ChangeDelete represents the delete operation.
ChangeModify represents the modify operation.
Gzip is gzip compression algorithm.
OverlayWhiteoutFormat formats whiteout according to the overlay standard.
Uncompressed represents the uncompressed.
WhiteoutLinkDir is a directory AUFS uses for storing hardlink links to other layers.
WhiteoutMetaPrefix prefix means whiteout has a special meaning and is not for removing an actual file.
WhiteoutOpaqueDir file means directory has been made opaque - meaning readdir calls to this directory do not follow to lower layers.
WhiteoutPrefix prefix means file is a whiteout.
Xz is xz compression algorithm.
# Variables
Errors used or returned by this file.
Errors used or returned by this file.
Errors used or returned by this file.
Errors used or returned by this file.
# Structs
Archiver implements the Archiver interface and allows the reuse of most utility functions of this package with a pluggable Untar function.
Change represents a change, it wraps the change type and path.
CopyInfo holds basic info about the source or destination path of a copy operation.
FileInfo describes the information of a file.
No description provided by the author
TempArchive is a temporary archive.
# Type aliases
ChangeType represents the change type.
No description provided by the author
TarModifierFunc is a function that can be passed to ReplaceFileTarWrapper to modify the contents or header of an entry in the archive.
No description provided by the author