Move layer interface definitions to distribution package
After consideration, it has been decided that the interfaces defined in the storage package provide a good base for interacting with various registry instances. Whether interacting with a remote API or a local, on-disk registry, these types have proved flexible. By moving them here, they can become the central components of interacting with distribution components. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package storage
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/docker/distribution"
|
||||
"github.com/docker/distribution/digest"
|
||||
)
|
||||
|
||||
@@ -15,7 +16,7 @@ type layerReader struct {
|
||||
digest digest.Digest
|
||||
}
|
||||
|
||||
var _ Layer = &layerReader{}
|
||||
var _ distribution.Layer = &layerReader{}
|
||||
|
||||
func (lrs *layerReader) Name() string {
|
||||
return lrs.name
|
||||
@@ -28,3 +29,8 @@ func (lrs *layerReader) Digest() digest.Digest {
|
||||
func (lrs *layerReader) CreatedAt() time.Time {
|
||||
return lrs.modtime
|
||||
}
|
||||
|
||||
// Close the layer. Should be called when the resource is no longer needed.
|
||||
func (lrs *layerReader) Close() error {
|
||||
return lrs.closeWithErr(distribution.ErrLayerClosed)
|
||||
}
|
||||
|
Reference in New Issue
Block a user