storage/storage_image.go
func (s *storageImageSource) GetBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache) (rc io.ReadCloser, n int64, err error) {
	if info.Digest == image.GzippedEmptyLayerDigest {
		return ioutil.NopCloser(bytes.NewReader(image.GzippedEmptyLayer)), int64(len(image.GzippedEmptyLayer)), nil
	}
	rc, n, _, err = s.getBlobAndLayerID(info)
	return rc, n, err
}
func (s *storageImageSource) GetBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache) (rc io.ReadCloser, n int64, err error) {
	if info.Digest == image.GzippedEmptyLayerDigest {
		return ioutil.NopCloser(bytes.NewReader(image.GzippedEmptyLayer)), int64(len(image.GzippedEmptyLayer)), nil
	}
	rc, n, _, err = s.getBlobAndLayerID(info)
	return rc, n, err
}
func ( s * storageImageSource ) GetBlob ( ctx context . Context , info types . BlobInfo , cache types . BlobInfoCache ) ( rc io . ReadCloser , n int64 , err error ) { if info . Digest == image . GzippedEmptyLayerDigest { return ioutil . NopCloser ( bytes . NewReader ( image . GzippedEmptyLayer ) ) , int64 ( len ( image . GzippedEmptyLayer ) ) , nil } rc , n , _ , err = s . getBlobAndLayerID ( info ) return rc , n , err }
// GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown).
// The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided.
// May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location.
GetBlob returns a stream for the specified blob and the blob’s size ( or - 1 if unknown ) . The Digest field in BlobInfo is guaranteed to be provided Size may be - 1 and MediaType may be optionally provided . May update BlobInfoCache preferably after it knows for certain that a blob truly exists at a specific location .