Refactoring cloudfactory layer handler into a more generic storage

middleware concept.

This also breaks the dependency the storage package had on goamz
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
This commit is contained in:
David Lawrence 2015-03-03 08:57:52 -08:00
parent 0c130dff5b
commit 4acda57e05
12 changed files with 160 additions and 294 deletions

View file

@ -2,6 +2,7 @@ package distribution
import (
"io"
"net/http"
"time"
"github.com/docker/distribution/digest"
@ -106,6 +107,11 @@ type Layer interface {
// CreatedAt returns the time this layer was created.
CreatedAt() time.Time
// ServeHTTP allows a layer to serve itself, whether by providing
// a redirect directly to the content, or by serving the content
// itself
ServeHTTP(w http.ResponseWriter, r *http.Request)
}
// LayerUpload provides a handle for working with in-progress uploads.