1
0
mirror of https://github.com/regclient/regclient.git synced 2025-07-29 09:01:11 +03:00

Refactor blob like manifests, add SetConfig

Signed-off-by: Brandon Mitchell <git@bmitch.net>
This commit is contained in:
Brandon Mitchell
2022-02-22 20:42:37 -05:00
parent 64717baf53
commit 5c3f85f253
9 changed files with 212 additions and 52 deletions

View File

@ -10,11 +10,13 @@ import (
// Common interface is provided by all Blob implementations
type Common interface {
Digest() digest.Digest
Length() int64
MediaType() string
GetDescriptor() ociv1.Descriptor
Response() *http.Response
RawHeaders() http.Header
Digest() digest.Digest // TODO: deprecate
Length() int64 // TODO: deprecate
MediaType() string // TODO: deprecate
}
type common struct {
@ -25,6 +27,11 @@ type common struct {
resp *http.Response
}
// GetDescriptor returns the descriptor associated with the blob
func (b *common) GetDescriptor() ociv1.Descriptor {
return b.desc
}
// Digest returns the provided or calculated digest of the blob
func (b *common) Digest() digest.Digest {
return b.desc.Digest