Documentation ¶
Overview ¶
Package reg implements the OCI registry scheme used by most images (host:port/repo:tag)
Index ¶
- Constants
- type Opts
- func WithBlobSize(chunk, max int64) 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 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 digest.Digest) error
- func (reg *Reg) BlobGet(ctx context.Context, r ref.Ref, d digest.Digest) (blob.Reader, error)
- func (reg *Reg) BlobHead(ctx context.Context, r ref.Ref, d digest.Digest) (blob.Reader, error)
- func (reg *Reg) BlobMount(ctx context.Context, rSrc ref.Ref, rTgt ref.Ref, d digest.Digest) error
- func (reg *Reg) BlobPut(ctx context.Context, r ref.Ref, d digest.Digest, rdr io.Reader, cl int64) (digest.Digest, int64, error)
- func (reg *Reg) Info() scheme.Info
- func (reg *Reg) ManifestDelete(ctx context.Context, r ref.Ref) 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) 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)
Constants ¶
const ( // DefaultBlobChunk 1M chunks, this is allocated in a memory buffer DefaultBlobChunk = 1024 * 1024 // DefaultBlobMax is disabled to support registries without chunked upload support DefaultBlobMax = -1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opts ¶
type Opts func(*Reg)
Opts provides options to access registries
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 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 ¶
BlobDelete removes a blob from the repository
func (*Reg) BlobMount ¶
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 digest.Digest, rdr io.Reader, cl int64) (digest.Digest, int64, error)
BlobPut uploads a blob to a repository. 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) 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