Documentation ¶
Index ¶
Constants ¶
const ( // DefaultTag defines the default tag used when performing images related actions and no tag or digest is specified DefaultTag = "latest" // DefaultRegistryHostname is the default built-in hostname // DefaultRegistryHostname = "index.docker.io" WrongRegistryHostname = "docker.io" DefaultRegistryHostname = "index.docker.io" // DefaultScheme is default scheme for registries DefaultScheme = "https" // DefaultRepoPrefix is the prefix used for default repositories in default host DefaultRepoPrefix = "library/" )
Variables ¶
This section is empty.
Functions ¶
func IsNameOnly ¶
IsNameOnly returns true if reference only contains a repo name.
func ValidateID ¶
ValidateID checks whether an ID string is a valid image ID.
Types ¶
type Canonical ¶
type Canonical interface { Named Digest() digest.Digest }
Canonical reference is an object with a fully unique name including a name with hostname and digest
func WithDigest ¶
WithDigest combines the name from "name" and the digest from "digest" to form a reference incorporating both the name and the digest.
type Named ¶
type Named interface { // Name returns normalized repository name, like "ubuntu". Name() string // String returns full reference, like "ubuntu@sha256:abcdef..." String() string // FullName returns full repository name with hostname, like "docker.io/library/ubuntu" FullName() string // Hostname returns hostname for the reference, like "docker.io" Hostname() string // RemoteName returns the repository component of the full name, like "library/ubuntu" RemoteName() string }
Named is an object with a full name
func ParseNamed ¶
ParseNamed parses s and returns a syntactically valid reference implementing the Named interface. The reference must have a name, otherwise an error is returned. If an error was encountered it is returned, along with a nil Reference.
func WithDefaultTag ¶
WithDefaultTag adds a default tag to a reference if it only has a repo name.
type NamedTagged ¶
NamedTagged is an object including a name and tag.
type Reference ¶
type Reference struct {
// contains filtered or unexported fields
}
Reference is an opaque object that include identifier such as a name, tag, repository, registry, etc...
func (Reference) Repository ¶
Repository returns the image's repository. (ie: registry/name)
type Repository ¶
type Repository struct { Name string // Name returns the image's name. (ie: debian[:8.2]) Repository string // Repository returns the image's repository. (ie: registry/name) Registry string // Registry returns the image's registry. (ie: host[:port]) Scheme string // Registry scheme. (ie: http) ShortName string // ShortName returns the image's name (ie: debian) Remote string // Remote returns the image's remote identifier. (ie: registry/name[:tag]) Tag string // Tag returns the image's tag (or digest). }
Repository is an object created from Named interface
func ParseRepo ¶
func ParseRepo(remote string) (*Repository, error)
ParseRepo - parses remote pretty much the same as Parse but better for testing