Refactor Layer interface to return a Handler

... Rather than ServeHTTP directly.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
This commit is contained in:
Josh Hawn 2015-03-12 19:31:41 -07:00
parent e062e66ee1
commit db5689aa86
4 changed files with 39 additions and 13 deletions

View file

@ -108,10 +108,10 @@ 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)
// 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)
}
// LayerUpload provides a handle for working with in-progress uploads.