forked from TrueCloudLab/distribution
e158e3cd65
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.
27 lines
875 B
Go
27 lines
875 B
Go
package registry
|
|
|
|
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
|
|
// be on this object.
|
|
type Context struct {
|
|
// App points to the application structure that created this context.
|
|
*App
|
|
|
|
// Name is the prefix for the current request. Corresponds to the
|
|
// namespace/repository associated with the image.
|
|
Name string
|
|
|
|
// Errors is a collection of errors encountered during the request to be
|
|
// returned to the client API. If errors are added to the collection, the
|
|
// handler *must not* start the response via http.ResponseWriter.
|
|
Errors Errors
|
|
|
|
// vars contains the extracted gorilla/mux variables that can be used for
|
|
// assignment.
|
|
vars map[string]string
|
|
|
|
// log provides a context specific logger.
|
|
log *logrus.Entry
|
|
}
|