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 ¶
- func Export(ctx context.Context, output io.Writer, root string) error
- func ExportRoot(ctx context.Context, output io.Writer, root *os.Root) error
- func FileDigest(path string) (int64, string, error)
- func Restore(ctx context.Context, archivePath, destination string) error
- func RestoreRootWithLimits(ctx context.Context, archivePath string, destination *os.Root, limits Limits) error
- func RestoreWithLimits(ctx context.Context, archivePath, destination string, limits Limits) error
- type Limits
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Export ¶
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 ¶
ExportRoot exports from a pinned directory handle so concurrent renames cannot redirect traversal outside the selected root.
func FileDigest ¶
FileDigest returns an archive's byte size and SHA-256 digest.
func Restore ¶
Restore restores an archive into an empty destination with conservative default extraction limits.