snapshotpayload

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package snapshotpayload materializes and hashes the logical user payload stored inside a snapshot directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckReservedWorkspacePayloadRoot

func CheckReservedWorkspacePayloadRoot(root string) error

CheckReservedWorkspacePayloadRoot fails closed when a workspace payload root contains names reserved by the snapshot storage control plane.

func Clean

func Clean(root string, opts Options) error

Clean normalizes an already-copied payload tree in place.

func ComputeHash

func ComputeHash(root string, opts Options) (model.HashValue, error)

ComputeHash computes the logical payload hash without mutating the snapshot storage tree.

func Materialize

func Materialize(src, dst string, opts Options, clone CloneFunc) error

Materialize clones a snapshot storage tree and normalizes it into the logical user payload: control markers are removed and compressed payload files are decoded when the descriptor says the snapshot is compressed.

func MaterializeToNew

func MaterializeToNew(src, dst string, opts Options, clone CloneFunc) error

MaterializeToNew clones a snapshot storage tree into an owned destination path whose leaf must not already exist, then normalizes it into user payload.

func MaterializedLogicalSize

func MaterializedLogicalSize(root string, opts Options) (int64, error)

MaterializedLogicalSize estimates the user payload size after materialization without cloning, decompressing, or hashing the snapshot storage tree.

func ReservedWorkspacePayloadRootNames

func ReservedWorkspacePayloadRootNames() []string

ReservedWorkspacePayloadRootNames returns names that cannot appear as user files at the workspace payload root because they collide with storage control markers.

Types

type CloneFunc

type CloneFunc func(src, dst string) error

CloneFunc copies a snapshot storage tree to a destination directory.

type MaterializationCapacityEstimate

type MaterializationCapacityEstimate struct {
	FinalBytes int64
	PeakBytes  int64
}

func EstimateMaterializationCapacity

func EstimateMaterializationCapacity(root string, opts Options) (MaterializationCapacityEstimate, error)

EstimateMaterializationCapacity estimates both final logical user payload bytes and the temporary peak written by MaterializeToNew without writing.

type Options

type Options struct {
	Compressed bool
}

Options describes how a snapshot payload is encoded on disk.

func OptionsForSnapshot

func OptionsForSnapshot(repoRoot string, snapshotID model.SnapshotID) (Options, error)

OptionsForSnapshot reads the snapshot descriptor and derives payload options.

func OptionsFromDescriptor

func OptionsFromDescriptor(desc *model.Descriptor) Options

OptionsFromDescriptor derives payload materialization options from a descriptor.

type ReservedWorkspacePayloadRootPathError

type ReservedWorkspacePayloadRootPathError struct {
	Name string
	Path string
}

ReservedWorkspacePayloadRootPathError reports a user payload root entry that collides with snapshot storage control paths.

func (*ReservedWorkspacePayloadRootPathError) Error

Jump to

Keyboard shortcuts

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