Adds storage driver interface, tests, and three basic implementations

Re-opening of #630 with the new orphan next-generation branch.

@dmp42 @wking @bacongobbler @noxiouz 
It definitely would be a good idea to allow the API request scope the
amount of data to receive back. But I don't know if something like 0, 100
is enough to express something meaningful.

On Monday, November 3, 2014, W. Trevor King <notifications@github.com>
wrote:

> In storagedriver/storagedriver.go:
>
> > +	// offset
> > +	// May be used to resume reading a stream by providing a nonzero offset
> > +	ReadStream(path string, offset uint64) (io.ReadCloser, error)
> > +
> > +	// WriteStream stores the contents of the provided io.ReadCloser at a location designated by
> > +	// the given path
> > +	// The driver will know it has received the full contents when it has read "size" bytes
> > +	// May be used to resume writing a stream by providing a nonzero offset
> > +	// The offset must be no larger than the ResumeWritePosition for this path
> > +	WriteStream(path string, offset, size uint64, readCloser io.ReadCloser) error
> > +
> > +	// ResumeWritePosition retrieves the byte offset at which it is safe to continue writing at the
> > +	// given path
> > +	ResumeWritePosition(path string) (uint64, error)
> > +
> > +	// List recursively lists the objects stored at a subpath of the given prefix
>
> On Mon, Nov 03, 2014 at 01:22:40PM -0800, Matthew Fisher wrote: What would
> be the use case for using `from` and `size`? How do you see them being used
> in the registry? If we're concerned about having the prefix at a high
> enough level being slow, we could make it optionally non-recursive:
> ```golang Count(prefix string) (int, error) List(prefix string, recursive
> bool) ([]string, error) ``` That should make `List("/", false)` only
> display `["images", "repositories"]` and `List("/images", false)`
> significantly less time-consuming than recursively listing * every*
> directory under /images.
> And List("/repositories", false) would list *all* the namespaces? I'd
> rather say: List("namespace/", 0, 100) for “give me the first hundred
> namespaces”. I'd avoid recursion by using namespaced keys (intead of
> heirarchical keys): namespace/alice namespace/bob namespace/library …
> repository/alice/busybox repository/bob/debian repository/library/debian …
> tag/alice/busybox/0.1 tag/bob/debian/latest tag/library/debian/latest so
> you could iterate through namespaces (with a “namespace/” prefix), or
> through repositories in a namespace (with a “repositories/alice/” prefix),
> or through all repositories (with a “repositories/” prefix), …
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/docker/docker-registry/pull/643/files#r19766926>.
>


-- 
Raymond "VisualPhoenix" Barbiero