Adds new storagedriver.FileWriter interface
Updates registry storage code to use this for better resumable writes. Implements this interface for the following drivers: + Inmemory + Filesystem + S3 + Azure Signed-off-by: Brian Bland <brian.bland@docker.com>
This commit is contained in:
parent
46b2c3fadf
commit
ff03381d49
37 changed files with 1429 additions and 3456 deletions
9
blobs.go
9
blobs.go
|
@ -189,9 +189,11 @@ type BlobCreateOption interface {
|
|||
// BlobWriteService.Resume. If supported by the store, a writer can be
|
||||
// recovered with the id.
|
||||
type BlobWriter interface {
|
||||
io.WriteSeeker
|
||||
io.WriteCloser
|
||||
io.ReaderFrom
|
||||
io.Closer
|
||||
|
||||
// Size returns the number of bytes written to this blob.
|
||||
Size() int64
|
||||
|
||||
// ID returns the identifier for this writer. The ID can be used with the
|
||||
// Blob service to later resume the write.
|
||||
|
@ -216,9 +218,6 @@ type BlobWriter interface {
|
|||
// result in a no-op. This allows use of Cancel in a defer statement,
|
||||
// increasing the assurance that it is correctly called.
|
||||
Cancel(ctx context.Context) error
|
||||
|
||||
// Get a reader to the blob being written by this BlobWriter
|
||||
Reader() (io.ReadCloser, error)
|
||||
}
|
||||
|
||||
// BlobService combines the operations to access, read and write blobs. This
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue