Initial implementation of Layer API

The http API has its first set of endpoints to implement the core aspects of
fetching and uploading layers. Uploads can be started and completed in a single
chunk and the content can be fetched via tarsum. Most proposed error conditions
should be represented but edge cases likely remain.

In this version, note that the layers are still called layers, even though the
routes are pointing to blobs. This will change with backend refactoring over
the next few weeks.

The unit tests are a bit of a shamble but these need to be carefully written
along with the core specification process. As the the client-server interaction
solidifies, we can port this into a verification suite for registry providers.
This commit is contained in:
Stephen J Day 2014-11-20 19:57:01 -08:00
parent 195568017a
commit e158e3cd65
6 changed files with 528 additions and 32 deletions

View file

@ -1,8 +1,6 @@
package registry
import (
"github.com/Sirupsen/logrus"
)
import "github.com/Sirupsen/logrus"
// Context should contain the request specific context for use in across
// handlers. Resources that don't need to be shared across handlers should not
@ -20,11 +18,6 @@ type Context struct {
// handler *must not* start the response via http.ResponseWriter.
Errors Errors
// TODO(stevvooe): Context would be a good place to create a
// representation of the "authorized resource". Perhaps, rather than
// having fields like "name", the context should be a set of parameters
// then we do routing from there.
// vars contains the extracted gorilla/mux variables that can be used for
// assignment.
vars map[string]string