artifactstore

package
v0.0.0-...-2769864 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

README

pkg/platform/artifactstore

The durable artifact storage abstraction the operator uses for tool stdin/stdout/stderr and input/output artifact handoff. The root declares the Store interface and the opaque, scheme-prefixed Ref type; the concrete implementation lives in blob.

A Store is chosen by DI at startup from ARTIFACT_STORE_URL — there is no registry here, because the binary picks exactly one.

Subpackages

Package What it is
blob Store over gocloud.dev/blob: one implementation across gs://, s3://, azblob://, file:// and mem://. The scheme is blank-imported per backend.

Constraints

  • Ref is opaque and store-relative. Key(ref) is the inverse of Put's ref construction; a foreign ref (different scheme, bucket, or base path) returns an error naming both bases rather than silently resolving.
  • Put must read to EOF before returning, and Delete is idempotent — no error when the object is already gone.
  • Get/Exists return ErrNotFound for an unresolvable ref; callers should match on it rather than on message text.
  • List pages with an opaque continue token; "" for next means last page.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("artifactstore: not found")

ErrNotFound is returned by Get/Exists when a Ref doesn't resolve.

Functions

This section is empty.

Types

type Item

type Item struct {
	Ref       Ref
	Key       string
	Size      int64
	CreatedAt time.Time
}

Item is a single artifact listing entry.

type ListOpts

type ListOpts struct {
	Prefix   string // optional; only refs whose internal key starts with Prefix
	Limit    int    // 0 → server default (100)
	Continue string // opaque continuation token from prior call
}

ListOpts controls filtering and pagination for List.

type Ref

type Ref string

Ref is an opaque, scheme-prefixed reference to a stored artifact (e.g., "mem://ns/session/call/stream", "s3://bucket/key").

type Store

type Store interface {
	// Put writes r's bytes under key and returns an opaque Ref.
	// Implementations must read r to EOF before returning.
	Put(ctx context.Context, key string, r io.Reader) (Ref, error)

	// Get returns a ReadCloser for the contents at ref.
	// Returns ErrNotFound if ref is unknown.
	Get(ctx context.Context, ref Ref) (io.ReadCloser, error)

	// Delete removes the artifact. Idempotent: no error if already gone.
	Delete(ctx context.Context, ref Ref) error

	// Exists is a cheap presence check.
	Exists(ctx context.Context, ref Ref) (bool, error)

	// List returns artifacts matching opts, with an opaque continue token
	// when more pages exist. Returns "" for next when the page is the last.
	List(ctx context.Context, opts ListOpts) (items []Item, next string, err error)

	// Key returns the internal storage key a Ref of this store resolves to —
	// the inverse of Put's Ref construction. Foreign refs (a different
	// scheme, bucket, or base path) return an error naming both bases.
	Key(ref Ref) (string, error)
}

Store is the artifact storage abstraction used by the operator for stdin/stdout/stderr and input/output artifact handoff.

Directories

Path Synopsis
Package blob implements artifactstore.Store over gocloud.dev/blob, giving one implementation across GCS (gs://), S3 (s3://), Azure Blob (azblob://), local disk (file://), and in-process memory (mem://).
Package blob implements artifactstore.Store over gocloud.dev/blob, giving one implementation across GCS (gs://), S3 (s3://), Azure Blob (azblob://), local disk (file://), and in-process memory (mem://).

Jump to

Keyboard shortcuts

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