Documentation
¶
Overview ¶
Package ociref supports parsing cross-registry OCI registry references.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidDigest ¶
IsValidDigest reports whether the digest d is well formed.
func IsValidHost ¶
IsValidHost reports whether s is a valid host (or host:port) part of a reference string.
func IsValidRepository ¶
IsValidHost reports whether s is a valid repository part of a reference string.
func IsValidTag ¶
IsValidTag reports whether s is a valid reference tag.
Types ¶
type Reference ¶
type Reference struct {
// Host holds the host name of the registry
// within which the repository is stored, optionally in
// the form host:port. This might be empty.
Host string
// Repository holds the repository name.
Repository string
// Tag holds the TAG part of a :TAG or :TAG@DIGEST reference.
// When Digest is set as well as Tag, the tag will be verified
// to exist and have the expected digest.
Tag string
// Digest holds the DIGEST part of an @DIGEST reference
// or of a :TAG@DIGEST reference.
Digest Digest
}
Reference represents an entry in an OCI repository.
func Parse ¶
Parse parses a reference string that must include a host name (or host:port pair) component.
It is represented in string form as HOST[:PORT]/NAME[:TAG|@DIGEST] form: the same syntax accepted by "docker pull". Unlike "docker pull" however, there is no default registry: when presented with a bare repository name, Parse will return an error.
func ParseRelative ¶
ParseRelative parses a reference string that may or may not include a host name component.
It is represented in string form as [HOST[:PORT]/]NAME[:TAG|@DIGEST] form: the same syntax accepted by "docker pull". Unlike "docker pull" however, there is no default registry: when presented with a bare repository name, the Host field will be empty.