inmem

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package inmem is Harbor's V1 in-memory ArtifactStore driver. It is the floor: every deployment can fall back to it (per-process lifetime, no persistence), and the conformance suite drives it as the canonical reference for Phase 18 (SQLite-blob, Postgres-blob) and Phase 19 (S3-style) drivers.

Internal model:

  • A single map keyed on a struct key `(scope, id)` holds the ref; a sibling map keyed by the same struct key holds the bytes. Two maps (rather than a struct holding both) so the bytes slice can be copy-on-read without copying ref fields.
  • A single `sync.RWMutex` guards both maps. The driver does no I/O so contention is bounded by Go's map throughput; a finer lock structure would be premature.
  • Bytes are deep-copied on Put and Get to defend against caller mutation (mirrors `internal/state/drivers/inmem` precedent).
  • `Close` flips an atomic flag; subsequent calls return wrapped `ErrStoreClosed`. There are no driver-owned goroutines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New constructs an ArtifactStore directly. Exposed for tests that want to skip the registry; production callers go through `artifacts.Open`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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