package ociref
import "cuelabs.dev/go/oci/ociregistry/ociref"
Package ociref supports parsing cross-registry OCI registry references.
Index ¶
- func IsValidDigest(d string) bool
- func IsValidHost(s string) bool
- func IsValidRepository(s string) bool
- func IsValidTag(s string) bool
- type Digest
- type Reference
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 Digest ¶
type Digest = digest.Digest
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.
func (Reference) String ¶
String returns the string form of a reference in the form
[HOST/]NAME[:TAG|@DIGEST]
Source Files ¶
reference.go
- Version
- v0.0.0-20241125120445-2c00c104c6e1 (latest)
- Published
- Nov 25, 2024
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 5 days ago –
Tools for package owners.