image

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 5 Imported by: 9

Documentation

Overview

Package image is concerned with docker image names and digests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Digest

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

Digest provides a CAS address of an image (either an image manifest or a manifest list).

var EmptyDigest Digest

EmptyDigest is an invalid, zero value for Digest.

func NewDigest

func NewDigest(dig string) (Digest, error)

NewDigest returns the Digest for a given digest string or an error if the digest string is invalid. The digest string must be of the form "alg:hash" where alg is an algorithm, such as sha256, and hash is a string output by that algorithm.

func (Digest) String

func (d Digest) String() string

String returns the string form of the Digest.

type Name

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

Name is a named image reference. It can refer to an image manifest or a manifest list (e.g. a multi-arch image).

var EmptyName Name

EmptyName is an invalid, zero value for Name.

func NewName

func NewName(i string) (Name, error)

NewName returns the Name for the given image reference or an error if the image reference is invalid.

func (Name) Digest

func (img Name) Digest() Digest

Digest returns the digest of the Name or EmptyDigest if the Name does not have a digest.

func (Name) Host

func (img Name) Host() string

Host returns the host of the Name. See also Path.

func (Name) Name

func (img Name) Name() string

Name returns the string form of the Name without any tag or digest.

func (Name) Normalize

func (img Name) Normalize() Name

Normalize returns a fully-qualified equivalent to the Name. Useful on synonyms.

func (Name) Path

func (img Name) Path() string

Path returns the path of the name. See also Host.

func (Name) String

func (img Name) String() string

String returns a string representation of the Name.

func (Name) Synonyms

func (img Name) Synonyms() []Name

Synonyms returns the image names equivalent to a given image name. A synonym is not necessarily normalized: in particular it may not have a host name.

func (Name) Tag

func (img Name) Tag() string

Tag returns the tag of the Name or an empty string if the Name is not tagged.

func (Name) WithDigest

func (img Name) WithDigest(digest Digest) (Name, error)

WithDigest returns a new Name with the same value as the Name, but with the given digest. It returns an error if and only if the digest is invalid.

func (Name) WithTag

func (img Name) WithTag(tag string) (Name, error)

WithTag returns a new Name with the same value as the Name, but with the given tag. It returns an error if and only if the tag is invalid.

func (Name) WithoutDigest

func (img Name) WithoutDigest() Name

WithoutDigest returns a new Name with the same value as the Name, but with any digest removed. It preserves any tag.

func (Name) WithoutTagOrDigest

func (img Name) WithoutTagOrDigest() Name

WithoutTagOrDigest returns a new Name with the same value as the Name, but with any tag or digest removed.

Jump to

Keyboard shortcuts

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