reference

package
v2.8.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package reference is deprecated, and has moved to github.com/distribution/reference.

Deprecated: use github.com/distribution/reference instead.

Index

Constants

View Source
const (
	// NameTotalLengthMax is the maximum total number of characters in a repository name.
	//
	// Deprecated: use [reference.NameTotalLengthMax].
	NameTotalLengthMax = reference.NameTotalLengthMax
)

Variables

View Source
var (
	// ErrReferenceInvalidFormat represents an error while trying to parse a string as a reference.
	//
	// Deprecated: use [reference.ErrReferenceInvalidFormat].
	ErrReferenceInvalidFormat = reference.ErrReferenceInvalidFormat

	// ErrTagInvalidFormat represents an error while trying to parse a string as a tag.
	//
	// Deprecated: use [reference.ErrTagInvalidFormat].
	ErrTagInvalidFormat = reference.ErrTagInvalidFormat

	// ErrDigestInvalidFormat represents an error while trying to parse a string as a tag.
	//
	// Deprecated: use [reference.ErrDigestInvalidFormat].
	ErrDigestInvalidFormat = reference.ErrDigestInvalidFormat

	// ErrNameContainsUppercase is returned for invalid repository names that contain uppercase characters.
	//
	// Deprecated: use [reference.ErrNameContainsUppercase].
	ErrNameContainsUppercase = reference.ErrNameContainsUppercase

	// ErrNameEmpty is returned for empty, invalid repository names.
	//
	// Deprecated: use [reference.ErrNameEmpty].
	ErrNameEmpty = reference.ErrNameEmpty

	// ErrNameTooLong is returned when a repository name is longer than NameTotalLengthMax.
	//
	// Deprecated: use [reference.ErrNameTooLong].
	ErrNameTooLong = reference.ErrNameTooLong

	// ErrNameNotCanonical is returned when a name is not canonical.
	//
	// Deprecated: use [reference.ErrNameNotCanonical].
	ErrNameNotCanonical = reference.ErrNameNotCanonical
)
View Source
var DigestRegexp = reference.DigestRegexp

DigestRegexp matches well-formed digests, including algorithm (e.g. "sha256:<encoded>").

Deprecated: use reference.DigestRegexp.

View Source
var DomainRegexp = reference.DigestRegexp

DomainRegexp matches hostname or IP-addresses, optionally including a port number. It defines the structure of potential domain components that may be part of image names. This is purposely a subset of what is allowed by DNS to ensure backwards compatibility with Docker image names. It may be a subset of DNS domain name, an IPv4 address in decimal format, or an IPv6 address between square brackets (excluding zone identifiers as defined by RFC 6874 or special addresses such as IPv4-Mapped).

Deprecated: use reference.DomainRegexp.

View Source
var IdentifierRegexp = reference.IdentifierRegexp

IdentifierRegexp is the format for string identifier used as a content addressable identifier using sha256. These identifiers are like digests without the algorithm, since sha256 is used.

Deprecated: use reference.IdentifierRegexp.

View Source
var NameRegexp = reference.NameRegexp

NameRegexp is the format for the name component of references, including an optional domain and port, but without tag or digest suffix.

Deprecated: use reference.NameRegexp.

View Source
var ReferenceRegexp = reference.ReferenceRegexp

ReferenceRegexp is the full supported format of a reference. The regexp is anchored and has capturing groups for name, tag, and digest components.

Deprecated: use reference.ReferenceRegexp.

View Source
var (
	// ShortIdentifierRegexp is the format used to represent a prefix
	// of an identifier. A prefix may be used to match a sha256 identifier
	// within a list of trusted identifiers.
	//
	// Deprecated: support for short-identifiers is deprecated, and will be removed in v3.
	ShortIdentifierRegexp = regexp.MustCompile(shortIdentifier)
)
View Source
var TagRegexp = reference.TagRegexp

TagRegexp matches valid tag names. From docker/docker:graph/tags.go.

Deprecated: use reference.TagRegexp.

Functions

func AsField deprecated

func AsField(ref reference.Reference) reference.Field

AsField wraps a reference in a Field for encoding.

Deprecated: use reference.AsField.

func Domain deprecated

func Domain(named reference.Named) string

Domain returns the domain part of the Named reference.

Deprecated: use reference.Domain.

func FamiliarMatch deprecated

func FamiliarMatch(pattern string, ref reference.Reference) (bool, error)

FamiliarMatch reports whether ref matches the specified pattern. See path.Match for supported patterns.

Deprecated: use reference.FamiliarMatch.

func FamiliarName deprecated

func FamiliarName(ref reference.Named) string

FamiliarName returns the familiar name string for the given named, familiarizing if needed.

Deprecated: use reference.FamiliarName.

func FamiliarString deprecated

func FamiliarString(ref reference.Reference) string

FamiliarString returns the familiar string representation for the given reference, familiarizing if needed.

Deprecated: use reference.FamiliarString.

func IsNameOnly deprecated

func IsNameOnly(ref reference.Named) bool

IsNameOnly returns true if reference only contains a repo name.

Deprecated: use reference.IsNameOnly.

func Parse deprecated

func Parse(s string) (reference.Reference, error)

Parse parses s and returns a syntactically valid Reference. If an error was encountered it is returned, along with a nil Reference.

Deprecated: use reference.Parse.

func ParseAnyReference deprecated

func ParseAnyReference(ref string) (reference.Reference, error)

ParseAnyReference parses a reference string as a possible identifier, full digest, or familiar name.

Deprecated: use reference.ParseAnyReference.

func ParseDockerRef deprecated

func ParseDockerRef(ref string) (reference.Named, error)

ParseDockerRef normalizes the image reference following the docker convention, which allows for references to contain both a tag and a digest.

Deprecated: use reference.ParseDockerRef.

func ParseNamed deprecated

func ParseNamed(s string) (reference.Named, error)

ParseNamed parses s and returns a syntactically valid reference implementing the Named interface. The reference must have a name and be in the canonical form, otherwise an error is returned. If an error was encountered it is returned, along with a nil Reference.

Deprecated: use reference.ParseNamed.

func ParseNormalizedNamed deprecated

func ParseNormalizedNamed(s string) (reference.Named, error)

ParseNormalizedNamed parses a string into a named reference transforming a familiar name from Docker UI to a fully qualified reference. If the value may be an identifier use ParseAnyReference.

Deprecated: use reference.ParseNormalizedNamed.

func Path deprecated

func Path(named reference.Named) (name string)

Path returns the name without the domain part of the Named reference.

Deprecated: use reference.Path.

func Sort deprecated

func Sort(references []string) []string

Sort sorts string references preferring higher information references.

Deprecated: use reference.Sort.

func SplitHostname deprecated

func SplitHostname(named reference.Named) (string, string)

SplitHostname splits a named reference into a hostname and name string. If no valid hostname is found, the hostname is empty and the full value is returned as name

Deprecated: Use reference.Domain or reference.Path.

func TagNameOnly deprecated

func TagNameOnly(ref reference.Named) reference.Named

TagNameOnly adds the default tag "latest" to a reference if it only has a repo name.

Deprecated: use reference.TagNameOnly.

func TrimNamed deprecated

func TrimNamed(ref reference.Named) reference.Named

TrimNamed removes any tag or digest from the named reference.

Deprecated: use reference.TrimNamed.

func WithDigest deprecated

func WithDigest(name reference.Named, digest digest.Digest) (reference.Canonical, error)

WithDigest combines the name from "name" and the digest from "digest" to form a reference incorporating both the name and the digest.

Deprecated: use reference.WithDigest.

func WithName deprecated

func WithName(name string) (reference.Named, error)

WithName returns a named object representing the given string. If the input is invalid ErrReferenceInvalidFormat will be returned.

Deprecated: use reference.WithName.

func WithTag deprecated

func WithTag(name reference.Named, tag string) (reference.NamedTagged, error)

WithTag combines the name from "name" and the tag from "tag" to form a reference incorporating both the name and the tag.

Deprecated: use reference.WithTag.

Types

type Canonical deprecated

type Canonical reference.Canonical

Canonical reference is an object with a fully unique name including a name with domain and digest

Deprecated: use reference.Canonical.

type Digested deprecated

type Digested reference.Digested

Digested is an object which has a digest in which it can be referenced by

Deprecated: use reference.Digested.

type Field deprecated

type Field = reference.Field

Field provides a wrapper type for resolving correct reference types when working with encoding.

Deprecated: use reference.Field.

type Named deprecated

type Named = reference.Named

Named is an object with a full name

Deprecated: use reference.Named.

type NamedTagged deprecated

type NamedTagged reference.NamedTagged

NamedTagged is an object including a name and tag.

Deprecated: use reference.NamedTagged.

type Reference deprecated

type Reference = reference.Reference

Reference is an opaque object reference identifier that may include modifiers such as a hostname, name, tag, and digest.

Deprecated: use reference.Reference.

func ParseAnyReferenceWithSet deprecated

func ParseAnyReferenceWithSet(ref string, ds *digestset.Set) (Reference, error)

ParseAnyReferenceWithSet parses a reference string as a possible short identifier to be matched in a digest set, a full digest, or familiar name.

Deprecated: support for short-identifiers is deprecated, and will be removed in v3.

type Tagged deprecated

type Tagged = reference.Tagged

Tagged is an object which has a tag

Deprecated: use reference.Tagged.

Jump to

Keyboard shortcuts

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