package archive
import "github.com/containerd/containerd/archive"
Index ¶
- func Apply(ctx context.Context, root string, r io.Reader, opts ...ApplyOpt) (int64, error)
- func Diff(ctx context.Context, a, b string) io.ReadCloser
- func WriteDiff(ctx context.Context, w io.Writer, a, b string, opts ...WriteDiffOpt) error
- type ApplyOpt
- func WithConvertWhiteout(c ConvertWhiteout) ApplyOpt
- func WithFilter(f Filter) ApplyOpt
- func WithParents(p []string) ApplyOpt
- type ApplyOptions
- type ConvertWhiteout
- type Filter
- type WriteDiffOpt
- type WriteDiffOptions
Functions ¶
func Apply ¶
Apply applies a tar stream of an OCI style diff tar. See https://github.com/opencontainers/image-spec/blob/master/layer.md#applying-changesets
func Diff ¶
func Diff(ctx context.Context, a, b string) io.ReadCloser
Diff returns a tar stream of the computed filesystem difference between the provided directories.
Produces a tar using OCI style file markers for deletions. Deleted files will be prepended with the prefix ".wh.". This style is based off AUFS whiteouts. See https://github.com/opencontainers/image-spec/blob/master/layer.md
func WriteDiff ¶
WriteDiff writes a tar stream of the computed difference between the provided paths.
Produces a tar using OCI style file markers for deletions. Deleted files will be prepended with the prefix ".wh.". This style is based off AUFS whiteouts. See https://github.com/opencontainers/image-spec/blob/master/layer.md
Types ¶
type ApplyOpt ¶
type ApplyOpt func(options *ApplyOptions) error
ApplyOpt allows setting mutable archive apply properties on creation
func WithConvertWhiteout ¶
func WithConvertWhiteout(c ConvertWhiteout) ApplyOpt
WithConvertWhiteout uses the convert function to convert the whiteout files.
func WithFilter ¶
WithFilter uses the filter to select which files are to be extracted.
func WithParents ¶
WithParents provides parent directories for resolving inherited attributes directory from the filesystem. Inherited attributes are searched from first to last, making the first element in the list the most immediate parent directory. NOTE: When applying to a filesystem which supports CoW, file attributes should be inherited by the filesystem.
type ApplyOptions ¶
type ApplyOptions struct { Filter Filter // Filter tar headers ConvertWhiteout ConvertWhiteout // Convert whiteout files Parents []string // Parent directories to handle inherited attributes without CoW // contains filtered or unexported fields }
ApplyOptions provides additional options for an Apply operation
type ConvertWhiteout ¶
ConvertWhiteout converts whiteout files from the archive
type Filter ¶
Filter specific files from the archive
type WriteDiffOpt ¶
type WriteDiffOpt func(options *WriteDiffOptions) error
WriteDiffOpt allows setting mutable archive write properties on creation
type WriteDiffOptions ¶
type WriteDiffOptions struct { ParentLayers []string // Windows needs the full list of parent layers // contains filtered or unexported fields }
WriteDiffOptions provides additional options for a WriteDiff operation
Source Files ¶
tar.go tar_mostunix.go tar_opts.go tar_unix.go time.go time_unix.go
Directories ¶
Path | Synopsis |
---|---|
archive/compression | |
archive/tartest |
- Version
- v1.5.1
- Published
- May 13, 2021
- Platform
- js/wasm
- Imports
- 17 packages
- Last checked
- 1 hour ago –
Tools for package owners.