Documentation
¶
Overview ¶
Package gc runs modular garbage collection: recovery precedes discovery, snapshots are loose, and every destructive decision is revalidated by the module under its own entity locks and tombstone leases.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlobIDs ¶
BlobIDs extracts blob hex IDs from a snapshot; nil if it doesn't implement UsedBlobIDs.
func Collect ¶
Collect aggregates ID sets from snapshots via accessor; snapshots that don't implement it are skipped.
func Register ¶
func Register[S any](o *Orchestrator, m Module[S])
Register is package-level because Go methods can't have type params.
Types ¶
type Module ¶
type Module[S any] struct { Name string // Recover resumes existing tombstones by phase before discovery, so a deleting entry whose data is already gone never reappears as a candidate. Optional. Recover func(ctx context.Context) []error // ReadDB reads the module's current state (self-locking snapshot). ReadDB func(ctx context.Context) (S, error) // Resolve returns IDs to delete; others holds snapshots from peer modules (cross-module analysis, e.g. VMs pinning images). Loose: collectors revalidate per candidate. Resolve func(ctx context.Context, snap S, others map[string]any) []string // Collect removes the given IDs, revalidating each under its entity lock and tombstone lease. Collect func(ctx context.Context, ids []string, snap S) error }
Module[S] is a typed GC participant; S is the snapshot type ReadDB returns and Resolve consumes.
type Orchestrator ¶
type Orchestrator struct {
// contains filtered or unexported fields
}
Orchestrator runs GC across all registered modules.
Click to show internal directories.
Click to hide internal directories.