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