modulepackage
0.6.0
Repository: https://github.com/distribution/reference.git
Documentation: pkg.go.dev
# README
Distribution reference
Go library to handle references to container images.
This repository contains a library for handling references to container images held in container registries. Please see godoc for details.
Contribution
Please see CONTRIBUTING.md for details on how to contribute issues, fixes, and patches to this project.
Communication
For async communication and long running discussions please use issues and pull requests on the github repo. This will be the best place to discuss design and implementation.
For sync communication we have a #distribution channel in the CNCF Slack that everyone is welcome to join and chat about development.
Licenses
The distribution codebase is released under the Apache 2.0 license.
# Functions
AsField wraps a reference in a Field for encoding.
Domain returns the domain part of the [Named] reference.
FamiliarMatch reports whether ref matches the specified pattern.
FamiliarName returns the familiar name string for the given named, familiarizing if needed.
FamiliarString returns the familiar string representation for the given reference, familiarizing if needed.
IsNameOnly returns true if reference only contains a repo name.
Parse parses s and returns a syntactically valid Reference.
ParseAnyReference parses a reference string as a possible identifier, full digest, or familiar name.
ParseDockerRef normalizes the image reference following the docker convention, which allows for references to contain both a tag and a digest.
ParseNamed parses s and returns a syntactically valid reference implementing the Named interface.
ParseNormalizedNamed parses a string into a named reference transforming a familiar name from Docker UI to a fully qualified reference.
Path returns the name without the domain part of the [Named] reference.
Sort sorts string references preferring higher information references.
TagNameOnly adds the default tag "latest" to a reference if it only has a repo name.
TrimNamed removes any tag or digest from the named reference.
WithDigest combines the name from "name" and the digest from "digest" to form a reference incorporating both the name and the digest.
WithName returns a named object representing the given string.
WithTag combines the name from "name" and the tag from "tag" to form a reference incorporating both the name and the tag.
# Constants
NameTotalLengthMax is the maximum total number of characters in a repository name.
RepositoryNameTotalLengthMax is the maximum total number of characters in a repository name.
# Variables
DigestRegexp matches well-formed digests, including algorithm (e.g.
DomainRegexp matches hostname or IP-addresses, optionally including a port number.
ErrDigestInvalidFormat represents an error while trying to parse a string as a tag.
ErrNameContainsUppercase is returned for invalid repository names that contain uppercase characters.
ErrNameEmpty is returned for empty, invalid repository names.
ErrNameNotCanonical is returned when a name is not canonical.
ErrNameTooLong is returned when a repository name is longer than RepositoryNameTotalLengthMax.
ErrReferenceInvalidFormat represents an error while trying to parse a string as a reference.
ErrTagInvalidFormat represents an error while trying to parse a string as a tag.
IdentifierRegexp is the format for string identifier used as a content addressable identifier using sha256.
NameRegexp is the format for the name component of references, including an optional domain and port, but without tag or digest suffix.
ReferenceRegexp is the full supported format of a reference.
TagRegexp matches valid tag names.
# Structs
Field provides a wrapper type for resolving correct reference types when working with encoding.
# Interfaces
Canonical reference is an object with a fully unique name including a name with domain and digest.
Digested is an object which has a digest in which it can be referenced by.
Named is an object with a full name.
NamedTagged is an object including a name and tag.
Reference is an opaque object reference identifier that may include modifiers such as a hostname, name, tag, and digest.
Tagged is an object which has a tag.