Documentation
¶
Overview ¶
Package snapshotpayload materializes and hashes the logical user payload stored inside a snapshot directory.
Index ¶
- func CheckReservedWorkspacePayloadRoot(root string) error
- func Clean(root string, opts Options) error
- func ComputeHash(root string, opts Options) (model.HashValue, error)
- func Materialize(src, dst string, opts Options, clone CloneFunc) error
- func MaterializeToNew(src, dst string, opts Options, clone CloneFunc) error
- func MaterializedLogicalSize(root string, opts Options) (int64, error)
- func ReservedWorkspacePayloadRootNames() []string
- type CloneFunc
- type MaterializationCapacityEstimate
- type Options
- type ReservedWorkspacePayloadRootPathError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckReservedWorkspacePayloadRoot ¶
CheckReservedWorkspacePayloadRoot fails closed when a workspace payload root contains names reserved by the snapshot storage control plane.
func ComputeHash ¶
ComputeHash computes the logical payload hash without mutating the snapshot storage tree.
func Materialize ¶
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 ¶
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 ¶
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 MaterializationCapacityEstimate ¶
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 ¶
ReservedWorkspacePayloadRootPathError reports a user payload root entry that collides with snapshot storage control paths.
func (*ReservedWorkspacePayloadRootPathError) Error ¶
func (e *ReservedWorkspacePayloadRootPathError) Error() string