client: make ImageImportResult an interface

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-11-03 17:46:11 +01:00
parent 5fc866fbfd
commit 5bfc628e97
4 changed files with 68 additions and 44 deletions

View File

@@ -19,22 +19,3 @@ type ImageImportOptions struct {
Changes []string // Changes are the raw changes to apply to this image
Platform ocispec.Platform // Platform is the target platform of the image
}
// ImageImportResult holds the response body returned by the daemon for image import.
type ImageImportResult struct {
rc io.ReadCloser
}
func (r ImageImportResult) Read(p []byte) (n int, err error) {
if r.rc == nil {
return 0, io.EOF
}
return r.rc.Read(p)
}
func (r ImageImportResult) Close() error {
if r.rc == nil {
return nil
}
return r.rc.Close()
}