archive

package
v1.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 AufsConvertWhiteout added in v1.3.0

func AufsConvertWhiteout(_ *tar.Header, _ string) (bool, error)

AufsConvertWhiteout converts whiteout files for aufs.

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 OverlayConvertWhiteout added in v1.3.0

func OverlayConvertWhiteout(hdr *tar.Header, path string) (bool, error)

OverlayConvertWhiteout converts whiteout files for overlay.

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 added in v1.1.0

type ApplyOpt func(options *ApplyOptions) error

ApplyOpt allows setting mutable archive apply properties on creation

func WithConvertWhiteout added in v1.3.0

func WithConvertWhiteout(c ConvertWhiteout) ApplyOpt

WithConvertWhiteout uses the convert function to convert the whiteout files.

func WithFilter added in v1.2.0

func WithFilter(f Filter) ApplyOpt

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

func WithParents added in v1.3.0

func WithParents(p []string) ApplyOpt

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 added in v1.1.0

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 added in v1.3.0

type ConvertWhiteout func(*tar.Header, string) (bool, error)

ConvertWhiteout converts whiteout files from the archive

type Filter added in v1.2.0

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

Filter specific files from the archive

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL