storage

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2016 License: Apache-2.0, Apache-2.0 Imports: 31 Imported by: 0

Documentation

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

Constants

This section is empty.

Variables

View Source
var ErrFinishedWalk = errors.New("finished walk")

ErrFinishedWalk is used when the called walk function no longer wants to accept any more values. This is used for pagination when the required number of items have been found.

View Source
var ErrSkipDir = errors.New("skip this directory")

ErrSkipDir is used as a return value from onFileFunc to indicate that the directory named in the call is to be skipped. It is not returned as an error by any function.

Functions

func DisableDigestResumption added in v1.1.1

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 added in v1.1.1

func EnableDelete(registry *registry) error

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

func EnableRedirect added in v1.1.1

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 EnumerateAllDigests added in v1.1.1

func EnumerateAllDigests(ms distribution.ManifestService) error

EnumerateAllDigests causes Enumerate method to include all the digests found without checking whether they exist and belong to manifest revisions or not.

func NewRegistry added in v1.1.1

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 RegistryBlobDeleter added in v1.1.1

func RegistryBlobDeleter(ns distribution.Namespace) (distribution.BlobDeleter, error)

RegistryBlobDeleter returns an instance of BlobDeleter for given registry object.

func RegistryBlobEnumerator added in v1.1.1

func RegistryBlobEnumerator(ns distribution.Namespace) (distribution.BlobEnumerator, error)

RegistryBlobEnumerator returns an instance of BlobEnumerator for given registry object.

func RemoveParentsOnDelete added in v1.1.1

func RemoveParentsOnDelete(registry *registry) error

RemoveParentsOnDelete is a functional option for NewRegistry. It causes parent directory of blob's data or link to be deleted as well during Delete. It should be used only with storage drivers providing strong consistency. Must be used together with `EnableDelete`.

func SkipLayerVerification added in v1.1.1

func SkipLayerVerification(ms distribution.ManifestService) error

SkipLayerVerification allows a manifest to be Put before it's layers are on the filesystem

func Walk

func Walk(ctx context.Context, driver storageDriver.StorageDriver, from string, f WalkFn) error

Walk traverses a filesystem defined within driver, starting from the given path, calling f on each file.

func WalkSortedChildren added in v1.1.1

func WalkSortedChildren(ctx context.Context, driver storageDriver.StorageDriver, from string, f WalkFn) error

WalkSortedChildren traverses a filesystem defined within driver, starting from the given path, calling f on each file in lexicographical order.

func WalkWithChildrenFilter added in v1.1.1

func WalkWithChildrenFilter(ctx context.Context, driver storageDriver.StorageDriver, from string, filter WalkChildrenFilter, f WalkFn) error

WalkWithChildrenFilter traverses a filesystem defined within driver, starting from the given path, calling f on each file. Given filter will be called on a list of directory children before being recursively processed.

Types

type RegistryOption added in v1.1.1

type RegistryOption func(*registry) error

RegistryOption is the type used for functional options for NewRegistry.

func BlobDescriptorCacheProvider added in v1.1.1

func BlobDescriptorCacheProvider(blobDescriptorCacheProvider cache.BlobDescriptorCacheProvider) RegistryOption

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

type Vacuum added in v1.1.1

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

Vacuum removes content from the filesystem

func NewVacuum added in v1.1.1

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

NewVacuum creates a new Vacuum

func (Vacuum) RemoveBlob added in v1.1.1

func (v Vacuum) RemoveBlob(dgst string) error

RemoveBlob removes a blob from the filesystem

func (Vacuum) RemoveRepository added in v1.1.1

func (v Vacuum) RemoveRepository(repoName string) error

RemoveRepository removes a repository directory from the filesystem

type WalkChildrenFilter added in v1.1.1

type WalkChildrenFilter func([]string) []string

WalkChildrenFilter transforms a list of directory children during a walk before before it's recursively traversed.

type WalkFn

type WalkFn func(fileInfo storageDriver.FileInfo) error

WalkFn is called once per file by Walk If the returned error is ErrSkipDir and fileInfo refers to a directory, the directory will not be entered and Walk will continue the traversal. Otherwise Walk will return

Directories

Path Synopsis
Package cache provides facilities to speed up access to the storage backend.
Package cache provides facilities to speed up access to the storage backend.
azure
Package azure provides a storagedriver.StorageDriver implementation to store blobs in Microsoft Azure Blob Storage Service.
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.
Package base provides a base implementation of the storage driver that can be used to implement common checks.
gcs
Package gcs implements the Google Cloud Storage driver backend.
Package gcs implements the Google Cloud Storage driver backend.
middleware/cloudfront
Package middleware - cloudfront wrapper for storage libs N.B. currently only works with S3, not arbitrary sites
Package middleware - cloudfront wrapper for storage libs N.B. currently only works with S3, not arbitrary sites
oss
Package oss implements the Aliyun OSS Storage driver backend.
Package oss implements the Aliyun OSS Storage driver backend.
rados
Package rados implements the rados storage driver backend.
Package rados implements the rados storage driver backend.
s3
Package s3 provides a storagedriver.StorageDriver implementation to store blobs in Amazon S3 cloud storage.
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.
Package swift provides a storagedriver.StorageDriver implementation to store blobs in Openstack Swift object storage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL