mirror of
https://github.com/containers/skopeo.git
synced 2025-06-28 15:47:34 +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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -23,6 +24,20 @@ type Repository interface {
|
|||||||
Image(ref string) Image // ref == image name w/o registry part
|
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.
|
// Image is a Docker image in a repository.
|
||||||
type Image interface {
|
type Image interface {
|
||||||
// ref to repository?
|
// ref to repository?
|
||||||
|
Loading…
Reference in New Issue
Block a user