mirror of
https://github.com/containers/skopeo.git
synced 2025-06-27 07:07:31 +00:00
Add types.ImageSource and types.ImageDestination
Right now, only a declaration. This will allow writing generalized push/pull between various storage mechanisms, and reuse of the Docker Registry client code for the Docker Registry embedded in OpenShift.
This commit is contained in:
parent
aff6aa7c2c
commit
a4aedae063
@ -2,6 +2,7 @@ package types
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -23,6 +24,20 @@ type Repository interface {
|
||||
Image(ref string) Image // ref == image name w/o registry part
|
||||
}
|
||||
|
||||
// ImageSource is a service, possibly remote (= slow), to download components of a single image.
|
||||
type ImageSource interface {
|
||||
GetManifest() (manifest []byte, unverifiedCanonicalDigest string, err error)
|
||||
GetLayer(digest string) (io.ReadCloser, error)
|
||||
GetSignatures() ([][]byte, error)
|
||||
}
|
||||
|
||||
// ImageDestination is a service, possibly remote (= slow), to store components of a single image.
|
||||
type ImageDestination interface {
|
||||
PutManifest([]byte) error
|
||||
PutLayer(digest string, stream io.Reader) error
|
||||
PutSignatures(signatures [][]byte) error
|
||||
}
|
||||
|
||||
// Image is a Docker image in a repository.
|
||||
type Image interface {
|
||||
// ref to repository?
|
||||
|
Loading…
Reference in New Issue
Block a user