image

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package volume provides bounded snapshot and restore mechanics for a caller-selected local volume or directory. Identity, authorization, retention, and transport policy belong to the caller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Export

func Export(ctx context.Context, output io.Writer, root string) error

Export writes a gzip-compressed tar archive containing regular files and directories below root. It refuses symlinks and special files so a snapshot cannot unexpectedly escape onto another host surface.

func ExportRoot

func ExportRoot(ctx context.Context, output io.Writer, root *os.Root) error

ExportRoot exports from a pinned directory handle so concurrent renames cannot redirect traversal outside the selected root.

func FileDigest

func FileDigest(path string) (int64, string, error)

FileDigest returns an archive's byte size and SHA-256 digest.

func Restore

func Restore(ctx context.Context, archivePath, destination string) error

Restore restores an archive into an empty destination with conservative default extraction limits.

func RestoreRootWithLimits

func RestoreRootWithLimits(ctx context.Context, archivePath string, destination *os.Root, limits Limits) error

RestoreRootWithLimits restores into a pinned empty directory.

func RestoreWithLimits

func RestoreWithLimits(ctx context.Context, archivePath, destination string, limits Limits) error

RestoreWithLimits stages extraction inside the empty destination and moves the validated top-level entries into place only after extraction succeeds.

Types

type Limits

type Limits struct {
	Bytes   int64
	Entries int
}

Limits bounds decompressed archive contents during restore.

Jump to

Keyboard shortcuts

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