Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Artifact types CycloneDXArtifactType = "application/vnd.cyclonedx+json" SPDXArtifactType = "application/spdx+json" // Sigstore bundle artifact type for Cosign attestations in "new bundle format" > 2.5.0 SigstoreBundleArtifactType = "application/vnd.dev.sigstore.bundle.v0.3+json" // DSSE envelope artifact type for legacy Cosign attestations (.att tag) DSSEEnvelopeArtifactType = "application/vnd.dsse.envelope.v1+json" // Generic in-toto artifact type, used by Docker Scout for every attestation. // The payload is either a bare in-toto statement or a DSSE envelope. InTotoArtifactType = "application/vnd.in-toto+json" // Media types OCIImageManifest = "application/vnd.oci.image.manifest.v1+json" // Optional annotation naming the in-toto predicate type of a referrer PredicateTypeAnnotation = "in-toto.io/predicate-type" )
Variables ¶
View Source
var SupportedSBOMArtifactTypes = []string{ CycloneDXArtifactType, SPDXArtifactType, SigstoreBundleArtifactType, }
Functions ¶
func Referrers ¶ added in v0.73.0
func Referrers(ctx context.Context, digest name.Digest, opts types.RegistryOptions, artifactTypes set.Set[string]) ([]v1.Descriptor, error)
Referrers lists the OCI 1.1 referrers of digest whose ArtifactType is one of artifactTypes, preserving the registry order. It returns an empty slice (not an error) when the registry exposes no matching referrers, so callers decide what "no referrers" means for them.
Types ¶
type Artifact ¶
type Artifact struct {
// For OCI registries
types.RegistryOptions
// contains filtered or unexported fields
}
Artifact is used to download artifacts such as vulnerability database and policies from OCI registries.
func NewArtifact ¶
func NewArtifact(repo string, registryOpt types.RegistryOptions, opts ...Option) *Artifact
NewArtifact returns a new artifact
func (*Artifact) Blob ¶ added in v0.73.0
Blob returns the uncompressed content of a single-layer OCI artifact as a stream. The caller must close it.
type Artifacts ¶ added in v0.56.0
type Artifacts []*Artifact
func NewArtifacts ¶ added in v0.56.0
NewArtifacts returns a slice of artifacts.
type DownloadOption ¶ added in v0.39.0
Click to show internal directories.
Click to hide internal directories.