package archive

import "github.com/containerd/containerd/archive"

Index

Functions

func Apply

func Apply(ctx context.Context, root string, r io.Reader, opts ...ApplyOpt) (int64, error)

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

func WriteDiff(ctx context.Context, w io.Writer, a, b string) error

WriteDiff writes a tar stream of the computed 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

Types

type ApplyOpt

type ApplyOpt func(options *ApplyOptions) error

ApplyOpt allows setting mutable archive apply properties on creation

func AsWindowsContainerLayer

func AsWindowsContainerLayer() ApplyOpt

AsWindowsContainerLayer indicates that the tar stream to apply is that of a Windows Container Layer. The caller must be holding SeBackupPrivilege and SeRestorePrivilege.

func WithFilter

func WithFilter(f Filter) ApplyOpt

WithFilter uses the filter to select which files are to be extracted.

func WithParentLayers

func WithParentLayers(parentPaths []string) ApplyOpt

WithParentLayers adds parent layers to the apply process this is required for all Windows layers except the base layer.

type ApplyOptions

type ApplyOptions struct {
	ParentLayerPaths        []string // Parent layer paths used for Windows layer apply
	IsWindowsContainerLayer bool     // True if the tar stream to be applied is a Windows Container Layer
	Filter                  Filter   // Filter tar headers
}

ApplyOptions provides additional options for an Apply operation

type Filter

type Filter func(*tar.Header) (bool, error)

Filter specific files from the archive

Source Files

strconv.go tar.go tar_opts.go tar_opts_windows.go tar_windows.go time.go time_windows.go

Directories

PathSynopsis
archive/compression
archive/tartest
Version
v1.2.7
Published
Jun 14, 2019
Platform
windows/amd64
Imports
25 packages
Last checked
23 minutes ago

Tools for package owners.