diff

package
v0.0.0-...-4af5f65 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2017 License: Apache-2.0, CC-BY-4.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// MediaType is the type of diff to generate
	// Default depends on the differ,
	// i.e. application/vnd.oci.image.layer.v1.tar+gzip
	MediaType string

	// Reference is the content upload reference
	// Default will use a random reference string
	Reference string

	// Labels are the labels to apply to the generated content
	Labels map[string]string
}

Config is used to hold parameters needed for a diff operation

type Differ

type Differ interface {
	// Apply applies the content referred to by the given descriptor to
	// the provided mount. The method of applying is based on the
	// implementation and content descriptor. For example, in the common
	// case the descriptor is a file system difference in tar format,
	// that tar would be applied on top of the mounts.
	Apply(ctx context.Context, desc ocispec.Descriptor, mount []mount.Mount) (ocispec.Descriptor, error)

	// DiffMounts computes the difference between two mounts and returns a
	// descriptor for the computed diff. The options can provide
	// a ref which can be used to track the content creation of the diff.
	// The media type which is used to determine the format of the created
	// content can also be provided as an option.
	DiffMounts(ctx context.Context, lower, upper []mount.Mount, opts ...Opt) (ocispec.Descriptor, error)
}

Differ allows the apply and creation of filesystem diffs between mounts

type Opt

type Opt func(*Config) error

Opt is used to configure a diff operation

func WithLabels

func WithLabels(labels map[string]string) Opt

WithLabels is used to set content labels on the created diff content.

func WithMediaType

func WithMediaType(m string) Opt

WithMediaType sets the media type to use for creating the diff, without specifying the differ will choose a default.

func WithReference

func WithReference(ref string) Opt

WithReference is used to set the content upload reference used by the diff operation. This allows the caller to track the upload through the content store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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