Documentation
¶
Overview ¶
Package restore is the init-container side: read HEAD.json from the backend, walk the manifest chain (full + increments in order), stream each one through hanzoai/vfs into db.Load(r). After this completes, the target ZapDB at the configured path holds a byte-equivalent copy of whatever the replicator most recently published.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Prune ¶
func Prune(ctx context.Context, cfg PruneConfig) error
Prune removes manifests older than the Nth-most-recent full snapshot, plus the blocks that ONLY those manifests reference.
Block GC: walk every surviving manifest, build a set of referenced block IDs. Any block in the to-delete manifests that is NOT in the survivor set can be deleted.
Types ¶
type Config ¶
type Config struct {
DBPath string // target path; created if it does not exist
Network string // sanity check — must match HEAD/manifests
VFS *vfs.VFS
Backend backend.Backend
// SkipIfNotEmpty: if true (default), restore aborts when the target
// already contains data. Set false to force restore over an
// existing dir.
SkipIfNotEmpty bool
}
Config wires a single restore run.
Click to show internal directories.
Click to hide internal directories.