archive

package
v5.10.2-0...-71545f2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Transport = archiveTransport{}

Transport is an ImageTransport for local Docker archives.

Functions

func NewIndexReference

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

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

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

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

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

func (r *Reader) Close() error

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

func (*Reader) List

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

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

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

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

func NewWriter

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

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

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