Versions in this module Expand all Collapse all v0 v0.1.0 Apr 16, 2025 Changes in this version + const Bzip2 + const ChangeAdd + const ChangeDelete + const ChangeModify + const Gzip + const ImpliedDirectoryMode + const Uncompressed + const WhiteoutLinkDir + const WhiteoutMetaPrefix + const WhiteoutOpaqueDir + const WhiteoutPrefix + const Xz + const Zstd + var ErrCannotCopyDir = errors.New("cannot copy directory") + var ErrDirNotExists = errors.New("no such directory") + var ErrInvalidCopySource = errors.New("invalid copy source content") + var ErrNotDirectory = errors.New("not a directory") + func ApplyLayer(dest string, layer io.Reader) (int64, error) + func ApplyUncompressedLayer(dest string, layer io.Reader, options *TarOptions) (int64, error) + func ChangesSize(newDir string, changes []Change) int64 + func CheckSystemDriveAndRemoveDriveLetter(path string) (string, error) + func CompressStream(dest io.Writer, comp compression.Compression) (io.WriteCloser, error) + func CopyResource(srcPath, dstPath string, followLink bool) error + func CopyTo(content io.Reader, srcInfo CopyInfo, dstPath string) error + func DecompressStream(archive io.Reader) (io.ReadCloser, error) + func DetectCompression(source []byte) compression.Compression + func ExportChanges(dir string, changes []Change, idMap user.IdentityMapping) (io.ReadCloser, error) + func FileInfoHeader(name string, fi os.FileInfo, link string) (*tar.Header, error) + func FileInfoHeaderNoLookups(fi os.FileInfo, link string) (*tar.Header, error) + func Generate(input ...string) (io.Reader, error) + func GetRebaseName(path, resolvedPath string) (string, string) + func IsArchivePath(path string) bool + func IsEmpty(rd io.Reader) (bool, error) + func PrepareArchiveCopy(srcContent io.Reader, srcInfo, dstInfo CopyInfo) (dstDir string, content io.ReadCloser, err error) + func PreserveTrailingDotOrSeparator(cleanedPath string, originalPath string) string + func ReadSecurityXattrToTarHeader(path string, hdr *tar.Header) error + func RebaseArchiveEntries(srcContent io.Reader, oldBase, newBase string) io.ReadCloser + func ReplaceFileTarWrapper(inputTarStream io.ReadCloser, mods map[string]TarModifierFunc) io.ReadCloser + func ResolveHostSourcePath(path string, followLink bool) (resolvedPath, rebaseName string, _ error) + func SplitPathDirEntry(path string) (dir, base string) + func Tar(path string, comp compression.Compression) (io.ReadCloser, error) + func TarResource(sourceInfo CopyInfo) (content io.ReadCloser, err error) + func TarResourceRebase(sourcePath, rebaseName string) (content io.ReadCloser, _ error) + func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error) + func Unpack(decompressedArchive io.Reader, dest string, options *TarOptions) error + func UnpackLayer(dest string, layer io.Reader, options *TarOptions) (size int64, err error) + func Untar(tarArchive io.Reader, dest string, options *TarOptions) error + func UntarUncompressed(tarArchive io.Reader, dest string, options *TarOptions) error + type Archiver struct + IDMapping user.IdentityMapping + Untar func(io.Reader, string, *TarOptions) error + func NewDefaultArchiver() *Archiver + func (archiver *Archiver) CopyFileWithTar(src, dst string) (err error) + func (archiver *Archiver) CopyWithTar(src, dst string) error + func (archiver *Archiver) IdentityMapping() user.IdentityMapping + func (archiver *Archiver) TarUntar(src, dst string) error + func (archiver *Archiver) UntarPath(src, dst string) error + type Change struct + Kind ChangeType + Path string + func Changes(layers []string, rw string) ([]Change, error) + func ChangesDirs(newDir, oldDir string) ([]Change, error) + func (change *Change) String() string + type ChangeType int + func (c ChangeType) String() string + type ChownOpts struct + GID int + UID int + type Compression = compression.Compression + type CopyInfo struct + Exists bool + IsDir bool + Path string + RebaseName string + func CopyInfoDestinationPath(path string) (info CopyInfo, err error) + func CopyInfoSourcePath(path string, followLink bool) (CopyInfo, error) + type FileInfo struct + func (info *FileInfo) Changes(oldInfo *FileInfo) []Change + func (info *FileInfo) LookUp(path string) *FileInfo + type TarModifierFunc func(path string, header *tar.Header, content io.Reader) (*tar.Header, []byte, error) + type TarOptions struct + BestEffortXattrs bool + ChownOpts *ChownOpts + Compression compression.Compression + ExcludePatterns []string + IDMap user.IdentityMapping + InUserNS bool + IncludeFiles []string + IncludeSourceDir bool + NoLchown bool + NoOverwriteDirNonDir bool + RebaseNames map[string]string + WhiteoutFormat WhiteoutFormat + func TarResourceRebaseOpts(sourceBase string, rebaseName string) *TarOptions + type Tarballer struct + func NewTarballer(srcPath string, options *TarOptions) (*Tarballer, error) + func (t *Tarballer) Do() + func (t *Tarballer) Reader() io.ReadCloser + type WhiteoutFormat int + const AUFSWhiteoutFormat + const OverlayWhiteoutFormat