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:
parent
e062e66ee1
commit
db5689aa86
4 changed files with 39 additions and 13 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue