artifact

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 10 Imported by: 0 modules, 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

Overview

Package artifact stores and serves the SHA-pinned repository tarballs that source-controller produces and agent jobs fetch. Paths embed a 128-bit random id, so a URL is unguessable by other workloads that can reach the serving port; the fetching init container verifies the sha256 digest end-to-end. The store is in-memory-indexed over plain files — artifacts are reproducible (a restart just re-fetches), so no durable index exists.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// URL the artifact is served at.
	URL string
	// Digest is the hex sha256 of the tarball.
	Digest string
	// Size in bytes.
	Size int64
}

Info describes one stored artifact.

type Store

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

Store keeps artifacts on disk keyed by owner name (the Repository object's namespaced name) and serves them over HTTP.

func NewStore

func NewStore(dir, baseURL string) (*Store, error)

NewStore builds a Store rooted at dir, minting URLs under baseURL (the cluster-internal address agents reach, e.g. http://patchy-source-controller.patchy.svc:9790).

func (*Store) Delete

func (s *Store) Delete(key string)

Delete removes the owner key's artifact, if present.

func (*Store) Get

func (s *Store) Get(key string) (*Info, bool)

Get returns the stored artifact info for the owner key, if present.

func (*Store) Handler

func (s *Store) Handler() http.Handler

Handler serves GET /artifacts/<id>.tar.gz.

func (*Store) Put

func (s *Store) Put(key string, r io.Reader) (*Info, error)

Put stores the tarball read from r under the owner key, replacing any previous artifact for that key, and returns its serving info.

Jump to

Keyboard shortcuts

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