Documentation
¶
Overview ¶
Cross-module GC protocols: snapshots opt in via the matching method; this file imports nothing concrete.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlobIDs ¶
BlobIDs extracts blob hex IDs from a snapshot. Returns nil if the snapshot does not 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 Locker lock.Locker // ReadDB reads the module's current state (called while the lock is held). ReadDB func(ctx context.Context) (S, error) // Resolve returns IDs to delete; others holds snapshots from peer modules (cast for cross-module analysis, e.g. VMs pinning images). Resolve func(ctx context.Context, snap S, others map[string]any) []string // Collect removes the given IDs (called while the lock is held). 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.
func New ¶
func New() *Orchestrator
Click to show internal directories.
Click to hide internal directories.