Documentation ¶
Index ¶
Constants ¶
const XDockerContainerPathStatHeader = "X-Docker-Container-Path-Stat"
XDockerContainerPathStatHeader is the *key* in http headers pointing to the base64 encoded JSON payload of stating a path in a container.
Variables ¶
var ErrENOENT = errors.New("no such file or directory")
ErrENOENT mimics the stdlib's ErrENOENT and can be used to implement custom logic while preserving the user-visible error message.
Functions ¶
func EncodeFileInfo ¶
EncodeFileInfo serializes the specified FileInfo as a base64 encoded JSON payload. Intended for Docker compat.
func ParseSourceAndDestination ¶
ParseSourceAndDestination parses the source and destination input into a possibly specified container and path. The input format is described in podman-cp(1) as "[nameOrID:]path". Colons in paths are supported as long they start with a dot or slash.
It returns, in order, the source container and path, followed by the destination container and path, and an error. Note that exactly one container must be specified.
func PreserveBasePath ¶
PreserveBasePath makes sure that the original base path (e.g., "/" or "./") is preserved. The filepath API among tends to clean up a bit too much but we *must* preserve this data by all means.
Types ¶
type FileInfo ¶
FileInfo describes a file or directory and is returned by (*CopyItem).Stat().
func ExtractFileInfoFromHeader ¶
ExtractFileInfoFromHeader extracts a base64 encoded JSON payload of a FileInfo in the http header. If no such header entry is found, nil is returned. Intended for Docker compat.
func ResolveHostPath ¶
ResolveHostPath resolves the specified, possibly relative, path on the host.