1
0
mirror of https://github.com/regclient/regclient.git synced 2025-07-27 21:41:46 +03:00

Blob changing from ReadCloser to Reader

Close and Seek methods are used when available.
Forcing a Closer resulted in a NoopCloser that blocked Seek.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
This commit is contained in:
Brandon Mitchell
2022-01-16 16:14:21 -05:00
parent 6724eef624
commit 1e588c18ef
3 changed files with 314 additions and 11 deletions

View File

@ -19,7 +19,7 @@ type BlobConfig struct {
header http.Header
image ociv1.Image
r ref.Ref
rc io.ReadCloser
rdr io.Reader
resp *http.Response
}
@ -41,9 +41,9 @@ func WithImage(image ociv1.Image) Opts {
bc.image = image
}
}
func WithReadCloser(rc io.ReadCloser) Opts {
func WithReader(rc io.Reader) Opts {
return func(bc *BlobConfig) {
bc.rc = rc
bc.rdr = rc
}
}
func WithRef(r ref.Ref) Opts {