oci

package
v0.50.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// Artifact types
	CycloneDXArtifactType = "application/vnd.cyclonedx+json"
	SPDXArtifactType      = "application/spdx+json"

	// Media types
	OCIImageManifest = "application/vnd.oci.image.manifest.v1+json"
)

Variables

View Source
var SupportedSBOMArtifactTypes = []string{
	CycloneDXArtifactType,
	SPDXArtifactType,
}

Functions

This section is empty.

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, quiet bool, registryOpt types.RegistryOptions, opts ...Option) (*Artifact, error)

NewArtifact returns a new artifact

func (*Artifact) Digest

func (a *Artifact) Digest(ctx context.Context) (string, error)

func (*Artifact) Download

func (a *Artifact) Download(ctx context.Context, dir string, opt DownloadOption) error

type DownloadOption added in v0.39.0

type DownloadOption struct {
	MediaType string // Accept any media type if not specified
	Filename  string // Use the annotation if not specified
}

type Option

type Option func(*Artifact)

Option is a functional option

func WithImage

func WithImage(img v1.Image) Option

WithImage takes an OCI v1 Image

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL