Documentation ¶
Overview ¶
Package reg implements the OCI registry scheme used by most images (host:port/repo:tag)
Index ¶
- Constants
- type Opts
- func WithBlobLimit(limit int64) Opts
- func WithBlobSize(size, max int64) Opts
- func WithCache(timeout time.Duration, count int) Opts
- func WithCertDirs(dirs []string) Opts
- func WithCertFiles(files []string) Opts
- func WithCerts(certs [][]byte) Opts
- func WithConfigHosts(configHosts []*config.Host) Opts
- func WithDelay(delayInit time.Duration, delayMax time.Duration) Opts
- func WithHTTPClient(hc *http.Client) Opts
- func WithLog(log *logrus.Logger) Opts
- func WithManifestMax(push, pull int64) Opts
- func WithRetryLimit(l int) Opts
- func WithTransport(t *http.Transport) Opts
- func WithUserAgent(ua string) Opts
- type Reg
- func (reg *Reg) BlobDelete(ctx context.Context, r ref.Ref, d descriptor.Descriptor) error
- func (reg *Reg) BlobGet(ctx context.Context, r ref.Ref, d descriptor.Descriptor) (blob.Reader, error)
- func (reg *Reg) BlobHead(ctx context.Context, r ref.Ref, d descriptor.Descriptor) (blob.Reader, error)
- func (reg *Reg) BlobMount(ctx context.Context, rSrc ref.Ref, rTgt ref.Ref, d descriptor.Descriptor) error
- func (reg *Reg) BlobPut(ctx context.Context, r ref.Ref, d descriptor.Descriptor, rdr io.Reader) (descriptor.Descriptor, error)
- func (reg *Reg) ManifestDelete(ctx context.Context, r ref.Ref, opts ...scheme.ManifestOpts) error
- func (reg *Reg) ManifestGet(ctx context.Context, r ref.Ref) (manifest.Manifest, error)
- func (reg *Reg) ManifestHead(ctx context.Context, r ref.Ref) (manifest.Manifest, error)
- func (reg *Reg) ManifestPut(ctx context.Context, r ref.Ref, m manifest.Manifest, ...) error
- func (reg *Reg) Ping(ctx context.Context, r ref.Ref) (ping.Result, error)
- func (reg *Reg) ReferrerList(ctx context.Context, r ref.Ref, opts ...scheme.ReferrerOpts) (referrer.ReferrerList, error)
- func (reg *Reg) RepoList(ctx context.Context, hostname string, opts ...scheme.RepoOpts) (*repo.RepoList, error)
- func (reg *Reg) TagDelete(ctx context.Context, r ref.Ref) error
- func (reg *Reg) TagList(ctx context.Context, r ref.Ref, opts ...scheme.TagOpts) (*tag.List, error)
- func (reg *Reg) Throttle(r ref.Ref, put bool) []*throttle.Throttle
Constants ¶
const OCISubjectHeader = "OCI-Subject"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opts ¶
type Opts func(*Reg)
Opts provides options to access registries
func WithBlobLimit ¶ added in v0.4.8
WithBlobLimit overrides default blob limit
func WithBlobSize ¶
WithBlobSize overrides default blob sizes
func WithCertDirs ¶
WithCertDirs adds certificate directories for host specific certs
func WithCertFiles ¶
WithCertFiles adds certificates by filename
func WithConfigHosts ¶
WithConfigHosts adds host configs for credentials
func WithDelay ¶
WithDelay initial time to wait between retries (increased with exponential backoff)
func WithHTTPClient ¶
WithHTTPClient uses a specific http client with retryable requests
func WithManifestMax ¶ added in v0.5.2
WithManifestMax sets the push and pull limits for manifests
func WithRetryLimit ¶
WithRetryLimit restricts the number of retries (defaults to 5)
func WithTransport ¶
WithTransport uses a specific http transport with retryable requests
type Reg ¶
type Reg struct {
// contains filtered or unexported fields
}
Reg is used for interacting with remote registry servers
func (*Reg) BlobDelete ¶
func (reg *Reg) BlobDelete(ctx context.Context, r ref.Ref, d descriptor.Descriptor) error
BlobDelete removes a blob from the repository
func (*Reg) BlobGet ¶
func (reg *Reg) BlobGet(ctx context.Context, r ref.Ref, d descriptor.Descriptor) (blob.Reader, error)
BlobGet retrieves a blob from the repository, returning a blob reader
func (*Reg) BlobHead ¶
func (reg *Reg) BlobHead(ctx context.Context, r ref.Ref, d descriptor.Descriptor) (blob.Reader, error)
BlobHead is used to verify if a blob exists and is accessible
func (*Reg) BlobMount ¶
func (reg *Reg) BlobMount(ctx context.Context, rSrc ref.Ref, rTgt ref.Ref, d descriptor.Descriptor) error
BlobMount attempts to perform a server side copy/mount of the blob between repositories
func (*Reg) BlobPut ¶
func (reg *Reg) BlobPut(ctx context.Context, r ref.Ref, d descriptor.Descriptor, rdr io.Reader) (descriptor.Descriptor, error)
BlobPut uploads a blob to a repository. Descriptor is optional, leave size and digest to zero value if unknown. Reader must also be an io.Seeker to support chunked upload fallback.
This will attempt an anonymous blob mount first which some registries may support. It will then try doing a full put of the blob without chunking (most widely supported). If the full put fails, it will fall back to a chunked upload (useful for flaky networks).
func (*Reg) ManifestDelete ¶
ManifestDelete removes a manifest by reference (digest) from a registry. This will implicitly delete all tags pointing to that manifest.
func (*Reg) ManifestGet ¶
ManifestGet retrieves a manifest from the registry
func (*Reg) ManifestHead ¶
ManifestHead returns metadata on the manifest from the registry
func (*Reg) ManifestPut ¶
func (reg *Reg) ManifestPut(ctx context.Context, r ref.Ref, m manifest.Manifest, opts ...scheme.ManifestOpts) error
ManifestPut uploads a manifest to a registry
func (*Reg) Ping ¶ added in v0.5.4
Ping queries the /v2/ API of the registry to verify connectivity and access.
func (*Reg) ReferrerList ¶ added in v0.4.3
func (reg *Reg) ReferrerList(ctx context.Context, r ref.Ref, opts ...scheme.ReferrerOpts) (referrer.ReferrerList, error)
ReferrerList returns a list of referrers to a given reference
func (*Reg) RepoList ¶
func (reg *Reg) RepoList(ctx context.Context, hostname string, opts ...scheme.RepoOpts) (*repo.RepoList, error)
RepoList returns a list of repositories on a registry Note the underlying "_catalog" API is not supported on many cloud registries
func (*Reg) TagDelete ¶
TagDelete removes a tag from a repository. It first attempts the newer OCI API to delete by tag name (not widely supported). If the OCI API fails, it falls back to pushing a unique empty manifest and deleting that.