2014-11-18 00:29:42 +00:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
2014-11-19 22:39:32 +00:00
|
|
|
|
|
|
|
"github.com/docker/docker-registry/digest"
|
2014-11-18 00:29:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// layerReadSeeker implements Layer and provides facilities for reading and
|
|
|
|
// seeking.
|
|
|
|
type layerReader struct {
|
2014-11-21 01:49:35 +00:00
|
|
|
fileReader
|
2014-11-18 00:29:42 +00:00
|
|
|
|
|
|
|
name string // repo name of this layer
|
2014-11-19 22:39:32 +00:00
|
|
|
digest digest.Digest
|
2014-11-18 00:29:42 +00:00
|
|
|
createdAt time.Time
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ Layer = &layerReader{}
|
|
|
|
|
|
|
|
func (lrs *layerReader) Name() string {
|
|
|
|
return lrs.name
|
|
|
|
}
|
|
|
|
|
2014-11-19 22:39:32 +00:00
|
|
|
func (lrs *layerReader) Digest() digest.Digest {
|
|
|
|
return lrs.digest
|
2014-11-18 00:29:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (lrs *layerReader) CreatedAt() time.Time {
|
|
|
|
return lrs.createdAt
|
|
|
|
}
|