Implement the Referrers interface on Artifact
Signed-off-by: Bracken Dawson <abdawson@gmail.com>
This commit is contained in:
parent
608a5708d5
commit
cd0c26c33c
2 changed files with 16 additions and 0 deletions
|
@ -115,3 +115,15 @@ func (m *DeserializedManifest) Payload() (string, []byte, error) {
|
|||
func (m *DeserializedManifest) References() []distribution.Descriptor {
|
||||
return m.Blobs
|
||||
}
|
||||
|
||||
// Subject returns a pointer to the subject of this manifest or nil if there is
|
||||
// none
|
||||
func (m *DeserializedManifest) Subject() *distribution.Descriptor {
|
||||
return m.Manifest.Subject
|
||||
}
|
||||
|
||||
// Type returns the artifactType of this manifest if there is one, otherwise it
|
||||
// returns empty string.
|
||||
func (m *DeserializedManifest) Type() string {
|
||||
return m.Manifest.ArtifactType
|
||||
}
|
||||
|
|
|
@ -32,6 +32,10 @@ type Referrer interface {
|
|||
// this manifest refers to or nil if this manifest does not refer to a
|
||||
// subject.
|
||||
Subject() *Descriptor
|
||||
|
||||
// Type returns the type of the referrer if there is one, otherwise it
|
||||
// returns empty string
|
||||
Type() string
|
||||
}
|
||||
|
||||
// ManifestBuilder creates a manifest allowing one to include dependencies.
|
||||
|
|
Loading…
Reference in a new issue