content

package
v1.164.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 18 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidDigest = errors.New("invalid artifact digest")

ErrInvalidDigest indicates that an identifier shaped like a digest (e.g. "sha256:...") does not match the expected format. Rejecting these prevents path-traversal when the digest is used as a filename component.

View Source
var ErrStoreCorrupted = errors.New("local artifact store corrupted")

ErrStoreCorrupted indicates that the local artifact store is in an inconsistent or partially missing state (e.g. missing tar, refs or metadata). Callers may safely attempt to re-fetch the artifact from the remote source.

Functions

func NewArtifactImage

func NewArtifactImage(base v1.Image, artifactType string) v1.Image

NewArtifactImage wraps an image so its serialized manifest includes the given artifactType.

Types

type ArtifactMetadata

type ArtifactMetadata struct {
	Digest      string            `json:"digest"`
	Reference   string            `json:"reference"`
	Size        int64             `json:"size"`
	StoredAt    time.Time         `json:"stored_at"`
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

ArtifactMetadata contains metadata about stored artifacts

type Opt

type Opt func(*Store)

func WithBaseDir

func WithBaseDir(baseDir string) Opt

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store manages the local content store for artifacts

func NewStore

func NewStore(opts ...Opt) (*Store, error)

NewStore creates a new content store

func (*Store) DeleteArtifact

func (s *Store) DeleteArtifact(identifier string) error

DeleteArtifact removes an artifact from the store

func (*Store) GetArtifact

func (s *Store) GetArtifact(identifier string) (string, error)

func (*Store) GetArtifactImage

func (s *Store) GetArtifactImage(identifier string) (v1.Image, error)

GetArtifactImage loads an artifact by digest or reference and returns it as a v1.Image

func (*Store) GetArtifactMetadata

func (s *Store) GetArtifactMetadata(identifier string) (*ArtifactMetadata, error)

GetArtifactMetadata returns metadata for an artifact by digest or reference

func (*Store) GetArtifactPath

func (s *Store) GetArtifactPath(identifier string) (string, error)

GetArtifactPath returns the file path for an artifact by digest or reference

func (*Store) ListArtifacts

func (s *Store) ListArtifacts() ([]ArtifactMetadata, error)

ListArtifacts returns a list of all stored artifacts

func (*Store) StoreArtifact

func (s *Store) StoreArtifact(img v1.Image, reference string) (string, error)

StoreArtifact stores an artifact with the given reference and returns its digest

Jump to

Keyboard shortcuts

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