rootfs

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2017 License: Apache-2.0, CC-BY-SA-4.0 Imports: 18 Imported by: 418

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyLayer

func ApplyLayer(ctx context.Context, layer Layer, chain []digest.Digest, sn snapshot.Snapshotter, a Applier) (bool, error)

ApplyLayer applies a single layer on top of the given provided layer chain, using the provided snapshotter and applier. If the layer was unpacked true is returned, if the layer already exists false is returned.

func ApplyLayers

func ApplyLayers(ctx context.Context, layers []Layer, sn snapshot.Snapshotter, a Applier) (digest.Digest, error)

ApplyLayers applies all the layers using the given snapshotter and applier. The returned result is a chain id digest representing all the applied layers. Layers are applied in order they are given, making the first layer the bottom-most layer in the layer chain.

func Diff

func Diff(ctx context.Context, snapshotID, contentRef string, sn snapshot.Snapshotter, md MountDiffer) (ocispec.Descriptor, error)

Diff creates a layer diff for the given snapshot identifier from the parent of the snapshot. A content ref is provided to track the progress of the content creation and the provided snapshotter and mount differ are used for calculating the diff. The descriptor for the layer diff is returned.

func InitRootFS

func InitRootFS(ctx context.Context, name string, parent digest.Digest, readonly bool, snapshotter snapshot.Snapshotter, mounter Mounter) ([]mount.Mount, error)

Types

type Applier

type Applier interface {
	Apply(context.Context, ocispec.Descriptor, []mount.Mount) (ocispec.Descriptor, error)
}

Applier is used to apply a descriptor of a layer diff on top of mounts.

type Layer

type Layer struct {
	Diff ocispec.Descriptor
	Blob ocispec.Descriptor
}

Layer represents the descriptors for a layer diff. These descriptions include the descriptor for the uncompressed tar diff as well as a blob used to transport that tar. The blob descriptor may or may not describe a compressed object.

type MountDiffer

type MountDiffer interface {
	DiffMounts(ctx context.Context, lower, upper []mount.Mount, media, ref string) (ocispec.Descriptor, error)
}

MountDiffer computes the difference between two mounts and returns a descriptor for the computed diff. The provided ref can be used to track the content creation of the diff and media type is used to determine the format of the created content.

type Mounter

type Mounter interface {
	Mount(target string, mounts ...mount.Mount) error
	Unmount(target string) error
}

Jump to

Keyboard shortcuts

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