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:
@ -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
|
||||
|
Reference in New Issue
Block a user