09bf752234
A Layer or LayerUpload should not be coupled with the containing repository. Remove the Name method and correctly reference from the repository where appropriate. Signed-off-by: Stephen J Day <stephen.day@docker.com>
31 lines
622 B
Go
31 lines
622 B
Go
package storage
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/docker/distribution"
|
|
"github.com/docker/distribution/digest"
|
|
)
|
|
|
|
// layerReadSeeker implements Layer and provides facilities for reading and
|
|
// seeking.
|
|
type layerReader struct {
|
|
fileReader
|
|
|
|
digest digest.Digest
|
|
}
|
|
|
|
var _ distribution.Layer = &layerReader{}
|
|
|
|
func (lrs *layerReader) Digest() digest.Digest {
|
|
return lrs.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)
|
|
}
|