archive

package
v5.30.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Transport = archiveTransport{}

Transport is an ImageTransport for local Docker archives.

Functions

func NewIndexReference added in v5.6.0

func NewIndexReference(path string, sourceIndex int) (types.ImageReference, error)

NewIndexReference returns a Docker archive reference for a path and a zero-based source manifest index.

func NewReference added in v5.3.0

func NewReference(path string, ref reference.NamedTagged) (types.ImageReference, error)

NewReference returns a Docker archive reference for a path and an optional reference.

func ParseReference

func ParseReference(refString string) (types.ImageReference, error)

ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an Docker ImageReference.

Types

type Reader added in v5.6.0

type Reader struct {
	// contains filtered or unexported fields
}

Reader manages a single Docker archive, allows listing its contents and accessing individual images with less overhead than creating image references individually (because the archive is, if necessary, copied or decompressed only once).

func NewReader added in v5.6.0

func NewReader(sys *types.SystemContext, path string) (*Reader, error)

NewReader returns a Reader for path. The caller should call .Close() on the returned object.

func NewReaderForReference added in v5.6.0

func NewReaderForReference(sys *types.SystemContext, ref types.ImageReference) (*Reader, types.ImageReference, error)

NewReaderForReference creates a Reader from a Reader-independent imageReference, which must be from docker/archive.Transport, and a variant of imageReference that points at the same image within the reader. The caller should call .Close() on the returned Reader.

func (*Reader) Close added in v5.6.0

func (r *Reader) Close() error

Close deletes temporary files associated with the Reader, if any.

func (*Reader) List added in v5.6.0

func (r *Reader) List() ([][]types.ImageReference, error)

List returns the a set of references for images in the Reader, grouped by the image the references point to. The references are valid only until the Reader is closed.

func (*Reader) ManifestTagsForReference added in v5.6.0

func (r *Reader) ManifestTagsForReference(ref types.ImageReference) ([]string, error)

ManifestTagsForReference returns the set of tags “matching” ref in reader, as strings (i.e. exposing the short names before normalization). The function reports an error if ref does not identify a single image. If ref contains a NamedTagged reference, only a single tag “matching” ref is returned; If ref contains a source index, or neither a NamedTagged nor a source index, all tags matching the image are returned. Almost all users should use List() or ImageReference.DockerReference() instead.

type Writer added in v5.6.0

type Writer struct {
	// contains filtered or unexported fields
}

Writer manages a single in-progress Docker archive and allows adding images to it.

func NewWriter added in v5.6.0

func NewWriter(sys *types.SystemContext, path string) (*Writer, error)

NewWriter returns a Writer for path. The caller should call .Close() on the returned object.

func (*Writer) Close added in v5.6.0

func (w *Writer) Close() error

Close writes all outstanding data about images to the archive, and releases state associated with the Writer, if any. No more images can be added after this is called.

func (*Writer) NewReference added in v5.6.0

func (w *Writer) NewReference(destinationRef reference.NamedTagged) (types.ImageReference, error)

NewReference returns an ImageReference that allows adding an image to Writer, with an optional reference.

Jump to

Keyboard shortcuts

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