Documentation
¶
Overview ¶
Package registry contains a client and server implementation of the OCI Distribution spec. Both client and server only support pulling. The server is intended for use in tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( RepositoryRegexp = regexp.MustCompile(`^` + repositoryExpr + `$`) TagRegexp = regexp.MustCompile(`^` + tagExpr + `$`) DigestRegexp = regexp.MustCompile(`^` + digestExpr + `$`) )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Transport will be used to make requests. For example, this allows // configuring TLS client and CA certificates. // If nil, [http.DefaultTransport] is used. Transport http.RoundTripper // GetBackOff can be set to to make the Client retry HTTP requests. GetBackOff func() backoff.BackOff // RetryNotify receives errors that trigger a retry, e.g. for logging. RetryNotify backoff.Notify // UserAgent is used as the User-Agent HTTP header. UserAgent string // Scheme must be either http or https. Scheme string // Host is the host with optional port. Host string // Repository is the name of the repository. It is part of the client because // bearer tokens are usually scoped to a repository. Repository string // contains filtered or unexported fields }
Client is an OCI registry client.
func (*Client) Read ¶
Read fetches a manifest from the registry and returns an oci.Ref.
The context is used for the manifest request and for all blob and manifest requests made through the Ref.
At least one of tag and digest must be set. If only tag is set, then you are trusting the registry to return the right content. Otherwise, the digest is used to verify the manifest. If both tag and digest are set, then the tag is used in the request, and the digest is used to verify the response. The advantage of fetching by tag is that it allows a pull through cache to display tags to a user inspecting the cache contents.
type ClientError ¶
ClientError is an HTTP error received from a registry or authorization service.
func (*ClientError) Error ¶
func (e *ClientError) Error() string