Documentation
¶
Overview ¶
Package restoreplan builds and persists preview plans for destructive restore operations.
Index ¶
- Constants
- func InspectSourceReadOnly(repoRoot string, sourceID model.SnapshotID) (*snapshot.PublishState, error)
- func PathEvidence(repoRoot, workspaceName, normalizedPath string) (string, error)
- func PathEvidenceFromRoot(root, normalizedPath string, excluded func(rel string) bool) (string, error)
- func SetCapacityGateForTest(gate capacitygate.Gate) func()
- func ValidatePathTarget(repoRoot, workspaceName string, plan *Plan) error
- func ValidateSource(repoRoot, workspaceName string, plan *Plan, engineType model.EngineType) error
- func ValidateSourcePath(repoRoot, workspaceName string, plan *Plan, engineType model.EngineType) error
- func ValidateTarget(repoRoot, workspaceName string, plan *Plan) error
- func WorkspaceEvidence(repoRoot, workspaceName string) (string, error)
- func Write(repoRoot string, plan *Plan) error
- type ChangeSummary
- type ManagedFilesImpact
- type Options
- type Plan
Constants ¶
View Source
const ( SchemaVersion = 1 ScopeWhole = "whole" ScopePath = "path" )
Variables ¶
This section is empty.
Functions ¶
func InspectSourceReadOnly ¶
func InspectSourceReadOnly(repoRoot string, sourceID model.SnapshotID) (*snapshot.PublishState, error)
func PathEvidence ¶
func PathEvidenceFromRoot ¶
func PathEvidenceFromRoot(root, normalizedPath string, excluded func(rel string) bool) (string, error)
PathEvidenceFromRoot computes path-level evidence for a managed payload root.
func SetCapacityGateForTest ¶
func SetCapacityGateForTest(gate capacitygate.Gate) func()
func ValidatePathTarget ¶
func ValidateSource ¶
func ValidateSource(repoRoot, workspaceName string, plan *Plan, engineType model.EngineType) error
func ValidateSourcePath ¶
func ValidateSourcePath(repoRoot, workspaceName string, plan *Plan, engineType model.EngineType) error
func ValidateTarget ¶
func WorkspaceEvidence ¶
Types ¶
type ChangeSummary ¶
type ManagedFilesImpact ¶
type ManagedFilesImpact struct {
Overwrite ChangeSummary `json:"overwrite"`
Delete ChangeSummary `json:"delete"`
Create ChangeSummary `json:"create"`
}
func ComputeManagedImpact ¶
func ComputeManagedImpact(repoRoot, workspaceName string, sourceID model.SnapshotID, engineType model.EngineType) (ManagedFilesImpact, error)
func ComputeManagedPathImpact ¶
func ComputeManagedPathImpact(repoRoot, workspaceName string, sourceID model.SnapshotID, path string, engineType model.EngineType) (ManagedFilesImpact, error)
type Plan ¶
type Plan struct {
SchemaVersion int `json:"schema_version"`
RepoID string `json:"repo_id"`
PlanID string `json:"plan_id"`
CreatedAt time.Time `json:"created_at"`
Scope string `json:"scope,omitempty"`
Folder string `json:"folder"`
Workspace string `json:"workspace"`
SourceSavePoint model.SnapshotID `json:"source_save_point"`
Path string `json:"path,omitempty"`
NewestSavePoint *model.SnapshotID `json:"newest_save_point"`
HistoryHead *model.SnapshotID `json:"history_head"`
ExpectedNewestSavePoint *model.SnapshotID `json:"expected_newest_save_point"`
ExpectedFolderEvidence string `json:"expected_folder_evidence,omitempty"`
ExpectedPathEvidence string `json:"expected_path_evidence,omitempty"`
Options Options `json:"options,omitempty"`
ManagedFiles ManagedFilesImpact `json:"managed_files"`
RunCommand string `json:"run_command"`
}
func Create ¶
func Create(repoRoot, workspaceName string, sourceID model.SnapshotID, engineType model.EngineType, options Options) (*Plan, error)
func CreatePath ¶
func CreatePath(repoRoot, workspaceName string, sourceID model.SnapshotID, path string, engineType model.EngineType, options Options) (*Plan, error)
func (*Plan) EffectiveScope ¶
Click to show internal directories.
Click to hide internal directories.