distribution – github.com/docker/distribution Index | Files | Directories

package distribution

import "github.com/docker/distribution"

Package distribution will define the interfaces for the components of docker distribution. The goal is to allow users to reliably package, ship and store content related to docker images.

This is currently a work in progress. More details are availalbe in the README.md.

Index

Variables

var (
	// ErrLayerExists returned when layer already exists
	ErrLayerExists = fmt.Errorf("layer exists")

	// ErrLayerTarSumVersionUnsupported when tarsum is unsupported version.
	ErrLayerTarSumVersionUnsupported = fmt.Errorf("unsupported tarsum version")

	// ErrLayerUploadUnknown returned when upload is not found.
	ErrLayerUploadUnknown = fmt.Errorf("layer upload unknown")

	// ErrLayerClosed returned when an operation is attempted on a closed
	// Layer or LayerUpload.
	ErrLayerClosed = fmt.Errorf("layer closed")
)
var GlobalScope = Scope(fullScope{})

GlobalScope represents the full namespace scope which contains all other scopes.

Types

type Descriptor

type Descriptor struct {
	// MediaType describe the type of the content. All text based formats are
	// encoded as utf-8.
	MediaType string `json:"mediaType,omitempty"`

	// Length in bytes of content.
	Length int64 `json:"length,omitempty"`

	// Digest uniquely identifies the content. A byte stream can be verified
	// against against this digest.
	Digest digest.Digest `json:"digest,omitempty"`
}

Descriptor describes targeted content. Used in conjunction with a blob store, a descriptor can be used to fetch, store and target any kind of blob. The struct also describes the wire protocol format. Fields should only be added but never changed.

type ErrLayerInvalidDigest

type ErrLayerInvalidDigest struct {
	Digest digest.Digest
	Reason error
}

ErrLayerInvalidDigest returned when tarsum check fails.

func (ErrLayerInvalidDigest) Error

func (err ErrLayerInvalidDigest) Error() string

type ErrManifestUnknown

type ErrManifestUnknown struct {
	Name string
	Tag  string
}

ErrManifestUnknown is returned if the manifest is not known by the registry.

func (ErrManifestUnknown) Error

func (err ErrManifestUnknown) Error() string

type ErrManifestUnverified

type ErrManifestUnverified struct{}

ErrManifestUnverified is returned when the registry is unable to verify the manifest.

func (ErrManifestUnverified) Error

func (ErrManifestUnverified) Error() string

type ErrManifestVerification

type ErrManifestVerification []error

ErrManifestVerification provides a type to collect errors encountered during manifest verification. Currently, it accepts errors of all types, but it may be narrowed to those involving manifest verification.

func (ErrManifestVerification) Error

func (errs ErrManifestVerification) Error() string

type ErrRepositoryNameInvalid

type ErrRepositoryNameInvalid struct {
	Name   string
	Reason error
}

ErrRepositoryNameInvalid should be used to denote an invalid repository name. Reason may set, indicating the cause of invalidity.

func (ErrRepositoryNameInvalid) Error

func (err ErrRepositoryNameInvalid) Error() string

type ErrRepositoryUnknown

type ErrRepositoryUnknown struct {
	Name string
}

ErrRepositoryUnknown is returned if the named repository is not known by the registry.

func (ErrRepositoryUnknown) Error

func (err ErrRepositoryUnknown) Error() string

type ErrUnknownLayer

type ErrUnknownLayer struct {
	FSLayer manifest.FSLayer
}

ErrUnknownLayer returned when layer cannot be found.

func (ErrUnknownLayer) Error

func (err ErrUnknownLayer) Error() string

type ErrUnknownManifestRevision

type ErrUnknownManifestRevision struct {
	Name     string
	Revision digest.Digest
}

ErrUnknownManifestRevision is returned when a manifest cannot be found by revision within a repository.

func (ErrUnknownManifestRevision) Error

func (err ErrUnknownManifestRevision) Error() string

type Layer

type Layer interface {
	// http.ServeContent requires an efficient implementation of
	// ReadSeeker.Seek(0, os.SEEK_END).
	io.ReadSeeker
	io.Closer

	// Digest returns the unique digest of the blob.
	Digest() digest.Digest

	// Length returns the length in bytes of the blob.
	Length() int64

	// CreatedAt returns the time this layer was created.
	CreatedAt() time.Time

	// Handler returns an HTTP handler which serves the layer content, whether
	// by providing a redirect directly to the content, or by serving the
	// content itself.
	Handler(r *http.Request) (http.Handler, error)
}

Layer provides a readable and seekable layer object. Typically, implementations are *not* goroutine safe.

type LayerService

type LayerService interface {
	// Exists returns true if the layer exists.
	Exists(digest digest.Digest) (bool, error)

	// Fetch the layer identifed by TarSum.
	Fetch(digest digest.Digest) (Layer, error)

	// Upload begins a layer upload to repository identified by name,
	// returning a handle.
	Upload() (LayerUpload, error)

	// Resume continues an in progress layer upload, returning a handle to the
	// upload. The caller should seek to the latest desired upload location
	// before proceeding.
	Resume(uuid string) (LayerUpload, error)
}

LayerService provides operations on layer files in a backend storage.

type LayerUpload

type LayerUpload interface {
	io.WriteSeeker
	io.ReaderFrom
	io.Closer

	// UUID returns the identifier for this upload.
	UUID() string

	// StartedAt returns the time this layer upload was started.
	StartedAt() time.Time

	// Finish marks the upload as completed, returning a valid handle to the
	// uploaded layer. The digest is validated against the contents of the
	// uploaded layer.
	Finish(digest digest.Digest) (Layer, error)

	// Cancel the layer upload process.
	Cancel() error
}

LayerUpload provides a handle for working with in-progress uploads. Instances can be obtained from the LayerService.Upload and LayerService.Resume.

type ManifestService

type ManifestService interface {
	// Exists returns true if the manifest exists.
	Exists(dgst digest.Digest) (bool, error)

	// Get retrieves the identified by the digest, if it exists.
	Get(dgst digest.Digest) (*manifest.SignedManifest, error)

	// Delete removes the manifest, if it exists.
	Delete(dgst digest.Digest) error

	// Put creates or updates the manifest.
	Put(manifest *manifest.SignedManifest) error

	// Tags lists the tags under the named repository.
	Tags() ([]string, error)

	// ExistsByTag returns true if the manifest exists.
	ExistsByTag(tag string) (bool, error)

	// GetByTag retrieves the named manifest, if it exists.
	GetByTag(tag string) (*manifest.SignedManifest, error)
}

ManifestService provides operations on image manifests.

type Namespace

type Namespace interface {
	// Scope describes the names that can be used with this Namespace. The
	// global namespace will have a scope that matches all names. The scope
	// effectively provides an identity for the namespace.
	Scope() Scope

	// Repository should return a reference to the named repository. The
	// registry may or may not have the repository but should always return a
	// reference.
	Repository(ctx context.Context, name string) (Repository, error)
}

Namespace represents a collection of repositories, addressable by name. Generally, a namespace is backed by a set of one or more services, providing facilities such as registry access, trust, and indexing.

type Repository

type Repository interface {
	// Name returns the name of the repository.
	Name() string

	// Manifests returns a reference to this repository's manifest service.
	Manifests() ManifestService

	// Layers returns a reference to this repository's layers service.
	Layers() LayerService

	// Signatures returns a reference to this repository's signatures service.
	Signatures() SignatureService
}

Repository is a named collection of manifests and layers.

type Scope

type Scope interface {
	// Contains returns true if the name belongs to the namespace.
	Contains(name string) bool
}

Scope defines the set of items that match a namespace.

type SignatureService

type SignatureService interface {
	// Get retrieves all of the signature blobs for the specified digest.
	Get(dgst digest.Digest) ([][]byte, error)

	// Put stores the signature for the provided digest.
	Put(dgst digest.Digest, signatures ...[]byte) error
}

SignatureService provides operations on signatures.

Source Files

doc.go errors.go registry.go

Directories

PathSynopsis
cmd
cmd/dist
cmd/registry
cmd/registry-api-descriptor-templateregistry-api-descriptor-template uses the APIDescriptor defined in the api/v2 package to execute templates passed to the command line.
configuration
contextPackage context provides several utilities for working with golang.org/x/net/context in http requests.
digestPackage digest provides a generalized type to opaquely represent message digests and their operations within the registry.
Godeps
Godeps/_workspace
Godeps/_workspace/src
Godeps/_workspace/src/code.google.com
Godeps/_workspace/src/code.google.com/p
Godeps/_workspace/src/code.google.com/p/go-uuid
Godeps/_workspace/src/code.google.com/p/go-uuid/uuidThe uuid package generates and inspects UUIDs.
Godeps/_workspace/src/github.com
Godeps/_workspace/src/github.com/AdRoll
Godeps/_workspace/src/github.com/AdRoll/goamz
Godeps/_workspace/src/github.com/AdRoll/goamz/awsgoamz - Go packages to interact with the Amazon Web Services.
Godeps/_workspace/src/github.com/AdRoll/goamz/cloudfront
Godeps/_workspace/src/github.com/AdRoll/goamz/s3
Godeps/_workspace/src/github.com/AdRoll/goamz/s3/s3test
Godeps/_workspace/src/github.com/bugsnag
Godeps/_workspace/src/github.com/bugsnag/bugsnag-goPackage bugsnag captures errors in real-time and reports them to Bugsnag (http://bugsnag.com).
Godeps/_workspace/src/github.com/bugsnag/bugsnag-go/errorsPackage errors provides errors that have stack-traces.
Godeps/_workspace/src/github.com/bugsnag/bugsnag-go/revelPackage bugsnagrevel adds Bugsnag to revel.
Godeps/_workspace/src/github.com/bugsnag/osextExtensions to the standard "os" package.
Godeps/_workspace/src/github.com/bugsnag/panicwrapThe panicwrap package provides functions for capturing and handling panics in your application.
Godeps/_workspace/src/github.com/codegangsta
Godeps/_workspace/src/github.com/codegangsta/cliPackage cli provides a minimal framework for creating and organizing command line Go applications.
Godeps/_workspace/src/github.com/docker
Godeps/_workspace/src/github.com/docker/docker
Godeps/_workspace/src/github.com/docker/docker/pkg
Godeps/_workspace/src/github.com/docker/docker/pkg/tarsum
Godeps/_workspace/src/github.com/docker/libtrustPackage libtrust provides an interface for managing authentication and authorization using public key cryptography.
Godeps/_workspace/src/github.com/docker/libtrust/testutil
Godeps/_workspace/src/github.com/docker/libtrust/tlsdemo
Godeps/_workspace/src/github.com/docker/libtrust/trustgraph
Godeps/_workspace/src/github.com/garyburd
Godeps/_workspace/src/github.com/garyburd/redigo
Godeps/_workspace/src/github.com/garyburd/redigo/internal
Godeps/_workspace/src/github.com/garyburd/redigo/redisPackage redis is a client for the Redis database.
Godeps/_workspace/src/github.com/gorilla
Godeps/_workspace/src/github.com/gorilla/contextPackage context stores values shared during a request lifetime.
Godeps/_workspace/src/github.com/gorilla/handlersPackage handlers is a collection of handlers for use with Go's net/http package.
Godeps/_workspace/src/github.com/gorilla/muxPackage gorilla/mux implements a request router and dispatcher.
Godeps/_workspace/src/github.com/jlhawn
Godeps/_workspace/src/github.com/jlhawn/go-cryptoPackage crypto is a Subset of the Go `crypto` Package with a Resumable Hash
Godeps/_workspace/src/github.com/jlhawn/go-crypto/sha256Package sha256 implements the SHA224 and SHA256 hash algorithms as defined in FIPS 180-4.
Godeps/_workspace/src/github.com/jlhawn/go-crypto/sha512Package sha512 implements the SHA384 and SHA512 hash algorithms as defined in FIPS 180-2.
Godeps/_workspace/src/github.com/MSOpenTech
Godeps/_workspace/src/github.com/MSOpenTech/azure-sdk-for-go
Godeps/_workspace/src/github.com/MSOpenTech/azure-sdk-for-go/storage
Godeps/_workspace/src/github.com/Sirupsen
Godeps/_workspace/src/github.com/Sirupsen/logrus
Godeps/_workspace/src/github.com/Sirupsen/logrus/examples
Godeps/_workspace/src/github.com/Sirupsen/logrus/examples/basic
Godeps/_workspace/src/github.com/Sirupsen/logrus/examples/hook
Godeps/_workspace/src/github.com/Sirupsen/logrus/formatters
Godeps/_workspace/src/github.com/Sirupsen/logrus/formatters/logstash
Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks
Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks/airbrake
Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks/bugsnag
Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks/papertrail
Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks/sentry
Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks/syslog
Godeps/_workspace/src/github.com/yvasiyarov
Godeps/_workspace/src/github.com/yvasiyarov/go-metricsGo port of Coda Hale's Metrics library
Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/cmd
Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/cmd/metrics-bench
Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/cmd/metrics-example
Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/cmd/never-read
Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/influxdb
Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/librato
Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/stathatMetrics output to StatHat.
Godeps/_workspace/src/github.com/yvasiyarov/gorelicPackage gorelic is an New Relic agent implementation for Go runtime.
Godeps/_workspace/src/github.com/yvasiyarov/gorelic/examples
Godeps/_workspace/src/github.com/yvasiyarov/newrelic_platform_goPackage newrelic_platform_go is New Relic Platform Agent SDK for Go language.
Godeps/_workspace/src/github.com/yvasiyarov/newrelic_platform_go/examples
Godeps/_workspace/src/golang.org
Godeps/_workspace/src/golang.org/x
Godeps/_workspace/src/golang.org/x/net
Godeps/_workspace/src/golang.org/x/net/contextPackage context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
Godeps/_workspace/src/gopkg.in
Godeps/_workspace/src/gopkg.in/check.v1Package check is a rich testing extension for Go's testing package.
Godeps/_workspace/src/gopkg.in/yaml.v2Package yaml implements YAML support for the Go language.
healthPackage health provides a generic health checking framework.
health/api
health/checks
manifest
notifications
registryPackage registry is a placeholder package for registry interface definitions and utilities.
registry/api
registry/api/v2Package v2 describes routes, urls and the error codes used in the Docker Registry JSON HTTP API V2.
registry/authPackage auth defines a standard interface for request access controllers.
registry/auth/sillyPackage silly provides a simple authentication scheme that checks for the existence of an Authorization header and issues access if is present and non-empty.
registry/auth/token
registry/client
registry/handlers
registry/middleware
registry/middleware/registry
registry/middleware/repository
registry/storagePackage storage contains storage services for use in the registry application.
registry/storage/cachePackage cache provides facilities to speed up access to the storage backend.
registry/storage/driver
registry/storage/driver/azurePackage azure provides a storagedriver.StorageDriver implementation to store blobs in Microsoft Azure Blob Storage Service.
registry/storage/driver/basePackage base provides a base implementation of the storage driver that can be used to implement common checks.
registry/storage/driver/factory
registry/storage/driver/filesystem
registry/storage/driver/inmemory
registry/storage/driver/middleware
registry/storage/driver/middleware/cloudfrontPackage middleware - cloudfront wrapper for storage libs N.B. currently only works with S3, not arbitrary sites
registry/storage/driver/s3Package s3 provides a storagedriver.StorageDriver implementation to store blobs in Amazon S3 cloud storage.
registry/storage/driver/testsuites
testutil
version
Version
v2.0.0-rc.3+incompatible
Published
Apr 10, 2015
Platform
js/wasm
Imports
8 packages
Last checked
10 hours ago

Tools for package owners.