...

Package storage

import "github.com/docker/distribution/registry/storage"
Overview
Index
Subdirectories

Overview ▾

Package storage contains storage services for use in the registry application. It should be considered an internal package, as of Go 1.4.

Index ▾

func DisableDigestResumption(registry *registry) error
func EnableDelete(registry *registry) error
func EnableRedirect(registry *registry) error
func EnableSchema1(registry *registry) error
func MarkAndSweep(ctx context.Context, storageDriver driver.StorageDriver, registry distribution.Namespace, opts GCOpts) error
func NewRegistry(ctx context.Context, driver storagedriver.StorageDriver, options ...RegistryOption) (distribution.Namespace, error)
func PurgeUploads(ctx context.Context, driver storageDriver.StorageDriver, olderThan time.Time, actuallyDelete bool) ([]string, []error)
func SkipLayerVerification() distribution.ManifestServiceOption
func WithMountFrom(ref reference.Canonical) distribution.BlobCreateOption
type GCOpts
type ManifestDel
type ManifestHandler
type RegistryOption
    func BlobDescriptorCacheProvider(blobDescriptorCacheProvider cache.BlobDescriptorCacheProvider) RegistryOption
    func BlobDescriptorServiceFactory(factory distribution.BlobDescriptorServiceFactory) RegistryOption
    func ManifestURLsAllowRegexp(r *regexp.Regexp) RegistryOption
    func ManifestURLsDenyRegexp(r *regexp.Regexp) RegistryOption
    func Schema1SigningKey(key libtrust.PrivateKey) RegistryOption
type Vacuum
    func NewVacuum(ctx context.Context, driver driver.StorageDriver) Vacuum
    func (v Vacuum) RemoveBlob(dgst string) error
    func (v Vacuum) RemoveManifest(name string, dgst digest.Digest, tags []string) error
    func (v Vacuum) RemoveRepository(repoName string) error

Package files

blobcachemetrics.go blobserver.go blobstore.go blobwriter.go blobwriter_resumable.go catalog.go doc.go error.go filereader.go garbagecollect.go io.go linkedblobstore.go manifestlisthandler.go manifeststore.go ocimanifesthandler.go paths.go purgeuploads.go registry.go schema2manifesthandler.go signedmanifesthandler.go tagstore.go v1unsupportedhandler.go vacuum.go

func DisableDigestResumption

func DisableDigestResumption(registry *registry) error

DisableDigestResumption is a functional option for NewRegistry. It should be used if the registry is acting as a caching proxy.

func EnableDelete

func EnableDelete(registry *registry) error

EnableDelete is a functional option for NewRegistry. It enables deletion on the registry.

func EnableRedirect

func EnableRedirect(registry *registry) error

EnableRedirect is a functional option for NewRegistry. It causes the backend blob server to attempt using (StorageDriver).URLFor to serve all blobs.

func EnableSchema1

func EnableSchema1(registry *registry) error

EnableSchema1 is a functional option for NewRegistry. It enables pushing of schema1 manifests.

func MarkAndSweep

func MarkAndSweep(ctx context.Context, storageDriver driver.StorageDriver, registry distribution.Namespace, opts GCOpts) error

MarkAndSweep performs a mark and sweep of registry data

func NewRegistry

func NewRegistry(ctx context.Context, driver storagedriver.StorageDriver, options ...RegistryOption) (distribution.Namespace, error)

NewRegistry creates a new registry instance from the provided driver. The resulting registry may be shared by multiple goroutines but is cheap to allocate. If the Redirect option is specified, the backend blob server will attempt to use (StorageDriver).URLFor to serve all blobs.

func PurgeUploads

func PurgeUploads(ctx context.Context, driver storageDriver.StorageDriver, olderThan time.Time, actuallyDelete bool) ([]string, []error)

PurgeUploads deletes files from the upload directory created before olderThan. The list of files deleted and errors encountered are returned

func SkipLayerVerification

func SkipLayerVerification() distribution.ManifestServiceOption

SkipLayerVerification allows a manifest to be Put before its layers are on the filesystem

func WithMountFrom

func WithMountFrom(ref reference.Canonical) distribution.BlobCreateOption

WithMountFrom returns a BlobCreateOption which designates that the blob should be mounted from the given canonical reference.

type GCOpts

GCOpts contains options for garbage collector

type GCOpts struct {
    DryRun         bool
    RemoveUntagged bool
}

type ManifestDel

ManifestDel contains manifest structure which will be deleted

type ManifestDel struct {
    Name   string
    Digest digest.Digest
    Tags   []string
}

type ManifestHandler

A ManifestHandler gets and puts manifests of a particular type.

type ManifestHandler interface {
    // Unmarshal unmarshals the manifest from a byte slice.
    Unmarshal(ctx context.Context, dgst digest.Digest, content []byte) (distribution.Manifest, error)

    // Put creates or updates the given manifest returning the manifest digest.
    Put(ctx context.Context, manifest distribution.Manifest, skipDependencyVerification bool) (digest.Digest, error)
}

type RegistryOption

RegistryOption is the type used for functional options for NewRegistry.

type RegistryOption func(*registry) error

func BlobDescriptorCacheProvider

func BlobDescriptorCacheProvider(blobDescriptorCacheProvider cache.BlobDescriptorCacheProvider) RegistryOption

BlobDescriptorCacheProvider returns a functional option for NewRegistry. It creates a cached blob statter for use by the registry.

func BlobDescriptorServiceFactory

func BlobDescriptorServiceFactory(factory distribution.BlobDescriptorServiceFactory) RegistryOption

BlobDescriptorServiceFactory returns a functional option for NewRegistry. It sets the factory to create BlobDescriptorServiceFactory middleware.

func ManifestURLsAllowRegexp

func ManifestURLsAllowRegexp(r *regexp.Regexp) RegistryOption

ManifestURLsAllowRegexp is a functional option for NewRegistry.

func ManifestURLsDenyRegexp

func ManifestURLsDenyRegexp(r *regexp.Regexp) RegistryOption

ManifestURLsDenyRegexp is a functional option for NewRegistry.

func Schema1SigningKey

func Schema1SigningKey(key libtrust.PrivateKey) RegistryOption

Schema1SigningKey returns a functional option for NewRegistry. It sets the key for signing all schema1 manifests.

type Vacuum

Vacuum removes content from the filesystem

type Vacuum struct {
    // contains filtered or unexported fields
}

func NewVacuum

func NewVacuum(ctx context.Context, driver driver.StorageDriver) Vacuum

NewVacuum creates a new Vacuum

func (Vacuum) RemoveBlob

func (v Vacuum) RemoveBlob(dgst string) error

RemoveBlob removes a blob from the filesystem

func (Vacuum) RemoveManifest

func (v Vacuum) RemoveManifest(name string, dgst digest.Digest, tags []string) error

RemoveManifest removes a manifest from the filesystem

func (Vacuum) RemoveRepository

func (v Vacuum) RemoveRepository(repoName string) error

RemoveRepository removes a repository directory from the filesystem

Subdirectories

Name Synopsis
..
cache Package cache provides facilities to speed up access to the storage backend.
cachecheck
memory
redis
driver
azure Package azure provides a storagedriver.StorageDriver implementation to store blobs in Microsoft Azure Blob Storage Service.
base Package base provides a base implementation of the storage driver that can be used to implement common checks.
factory
filesystem
gcs Package gcs implements the Google Cloud Storage driver backend.
inmemory
middleware
cloudfront Package middleware - cloudfront wrapper for storage libs N.B. currently only works with S3, not arbitrary sites
redirect
oss Package oss implements the Aliyun OSS Storage driver backend.
s3-aws Package s3 provides a storagedriver.StorageDriver implementation to store blobs in Amazon S3 cloud storage.
swift Package swift provides a storagedriver.StorageDriver implementation to store blobs in Openstack Swift object storage.
testdriver
testsuites