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 ¶
func New(_ config.ArtifactsConfig) (artifacts.ArtifactStore, error)
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.
Click to show internal directories.
Click to hide internal directories.