From 0bc84606ccf67913b0f69c4c925bd3aa875e43a6 Mon Sep 17 00:00:00 2001 From: Brian Bland Date: Thu, 5 Feb 2015 17:37:52 -0800 Subject: [PATCH] Makes LayerUpload an io.ReaderFrom This allows wrappers of LayerUpload to implement io.ReadFrom, which prevents io.Copy on LayerUpload implementations from using repeated 32kB Writes. This has a huge performance implication, especially for s3/azure storage drivers. --- storage/layer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/layer.go b/storage/layer.go index 627a3b5f..5e12f43e 100644 --- a/storage/layer.go +++ b/storage/layer.go @@ -33,6 +33,7 @@ type Layer interface { // LayerService.Resume. type LayerUpload interface { io.WriteSeeker + io.ReaderFrom io.Closer // Name of the repository under which the layer will be linked.