Documentation ¶
Index ¶
- func ApplyLayer(ctx context.Context, layer Layer, chain []digest.Digest, ...) (bool, error)
- func ApplyLayers(ctx context.Context, layers []Layer, sn snapshot.Snapshotter, a Applier) (digest.Digest, error)
- func Diff(ctx context.Context, snapshotID, contentRef string, sn snapshot.Snapshotter, ...) (ocispec.Descriptor, error)
- func InitRootFS(ctx context.Context, name string, parent digest.Digest, readonly bool, ...) ([]mount.Mount, error)
- type Applier
- type Layer
- type MountDiffer
- type Mounter
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.
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.