Documentation
¶
Overview ¶
Package reference parses OCI image references and resolves tags to digests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FamiliarString ¶ added in v0.4.0
FamiliarString returns a reference in its short form: busybox:latest for docker.io/library/busybox:latest. An invalid reference is returned as is.
func ShortDigest ¶ added in v0.4.0
ShortDigest abbreviates a digest for a person, as git does a commit: "sha256:1a2b3c4d5e6f". A digest too short to abbreviate, or without an algorithm, is returned as is.
Types ¶
type Ref ¶
type Ref struct {
// contains filtered or unexported fields
}
Ref is a parsed OCI image reference in its normalised form, such as docker.io/library/alpine:latest.
func Parse ¶
Parse validates and normalises an image reference: the registry and library path Docker assumes are filled in, and a reference with neither tag nor digest is tagged latest.
func (*Ref) Repository ¶
Repository returns the reference without its tag or digest, such as docker.io/library/alpine.
type ResolvedRef ¶
type ResolvedRef struct {
// contains filtered or unexported fields
}
ResolvedRef is an image reference pinned to a manifest digest.
func Resolve ¶
Resolve pins ref to a manifest digest: its own if it names one, otherwise the one resolver finds for its tag. resolver may be nil only for a reference by digest.
func (*ResolvedRef) Digest ¶ added in v0.4.0
func (r *ResolvedRef) Digest() string
Digest returns the manifest digest the reference was resolved to.
func (*ResolvedRef) DigestHex ¶
func (r *ResolvedRef) DigestHex() string
DigestHex returns the digest without its algorithm prefix, suitable for use as a directory name.
func (*ResolvedRef) String ¶ added in v0.4.0
func (r *ResolvedRef) String() string
String returns the normalised reference, as it was before it was resolved.