Documentation
¶
Overview ¶
Package localbackupruntime adapts the owner-bound local backup lifecycle to the fixed Kopia container runtime without retaining repository secrets.
Index ¶
- Constants
- func RepositoryIDForCoreModule(coreModuleRef string) string
- type AppGroupSnapshotBinding
- type Runtime
- func (r *Runtime) BindAppGroupSnapshots(binding AppGroupSnapshotBinding) error
- func (r *Runtime) BindApplicationTransferClosure(closure []localbackuppolicy.ApplicationRuntime, ...) error
- func (r *Runtime) BindApplicationTransferExport(export func(context.Context) error) error
- func (r *Runtime) BindApplicationTransferHold(id func() string) error
- func (r *Runtime) BindApplicationTransferResume(id string) error
- func (r *Runtime) BindMarketplaceControl(...) error
- func (r *Runtime) CloseFailedSnapshotAppGroupHolds(ctx context.Context, groups []backuplifecycle.AppGroupControl) error
- func (r *Runtime) CloseSnapshotAppGroupHolds(ctx context.Context, anchor backuplifecycle.SnapshotAnchor) error
- func (r *Runtime) Configure(ctx context.Context, configuration backuplifecycle.RepositoryConfiguration) (backuplifecycle.RepositoryReceipt, error)
- func (r *Runtime) CreateSnapshot(ctx context.Context, request backuplifecycle.RepositorySnapshotRequest) (backuplifecycle.RepositorySnapshotReceipt, error)
- func (r *Runtime) CreateSnapshotWithQuiescence(ctx context.Context, request backuplifecycle.RepositorySnapshotRequest, ...) (receipt backuplifecycle.RepositorySnapshotReceipt, resultErr error)
- func (r *Runtime) LookupSnapshot(ctx context.Context, request backuplifecycle.RepositorySnapshotRequest) (backuplifecycle.RepositorySnapshotReceipt, bool, error)
- func (r *Runtime) RestoreSnapshot(ctx context.Context, request backuplifecycle.RepositoryRestoreRequest) (backuplifecycle.RepositoryRestoreReceipt, error)
- func (r *Runtime) Status(ctx context.Context, scope backuplifecycle.RepositoryScope) (backuplifecycle.RepositoryStatus, error)
Constants ¶
const ( RepositoryID = "kopia:local:basement" CloudRepositoryID = "kopia:local:cloud" Backend = "filesystem" )
Variables ¶
This section is empty.
Functions ¶
func RepositoryIDForCoreModule ¶ added in v0.46.8
RepositoryIDForCoreModule names the local Kopia repository that the kit core owning the source policy writes: the Cloud standalone core its own Cloud repository, every Basement core the Basement repository.
Types ¶
type AppGroupSnapshotBinding ¶ added in v0.54.10
type AppGroupSnapshotBinding struct {
Core backupexec.ContainerQuiescer
Capture func(context.Context, string) (backuplifecycle.AppGroupControl, error)
Driver func(context.Context, backuplifecycle.AppGroupControl) (backuplifecycle.AppGroupControlDriver, error)
}
AppGroupSnapshotBinding belongs to the existing node-custody adapter. Core is the existing exact-container quiescer after the selected app-group has been separated; Capture must derive one complete current daemon graph from the held Plan/Apply/Owner, never discovery or caller-selected container names. No binding is installed by default or merely from a runtipi catalog value.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime is the production RepositoryRuntime for the CUE-owned local Kopia service. It retains only a confined workspace name and an engine factory.
func New ¶
func New(workspaceRoot string, policy localbackuppolicy.Policy, custody backupexec.ApplicationContainerCustodyVerifier, bindings ...backupexec.ApplicationRuntimeBinding) (*Runtime, error)
New binds all current repository operations to the exact policy already verified through the Plan, artifact and Apply authority chain. Copy through the canonical codec so caller-owned slices cannot change the source selection after the runtime is created.
func NewApplicationSnapshotRuntime ¶ added in v0.54.10
func NewApplicationSnapshotRuntime(workspace string, policy localbackuppolicy.Policy, custody backupexec.ApplicationContainerCustodyVerifier, workloads []string, bindings ...backupexec.ApplicationRuntimeBinding) (*Runtime, error)
NewApplicationSnapshotRuntime uses the existing repository and quiescence journal with an explicit signed selection, never a replacement backup owner.
func NewWithAppGroupSnapshots ¶ added in v0.54.10
func NewWithAppGroupSnapshots(workspace string, policy localbackuppolicy.Policy, custody backupexec.ApplicationContainerCustodyVerifier, groups AppGroupSnapshotBinding, bindings ...backupexec.ApplicationRuntimeBinding) (*Runtime, error)
NewWithAppGroupSnapshots binds native group control at construction, so no partially configured runtime can snapshot an uncontrolled group. Repository, Kopia policy, source translation and settlement retain their existing owners.
func (*Runtime) BindAppGroupSnapshots ¶ added in v0.54.10
func (r *Runtime) BindAppGroupSnapshots(binding AppGroupSnapshotBinding) error
func (*Runtime) BindApplicationTransferClosure ¶ added in v0.54.10
func (r *Runtime) BindApplicationTransferClosure(closure []localbackuppolicy.ApplicationRuntime, custody backupexec.ApplicationContainerCustodyVerifier) error
BindApplicationTransferClosure keeps data sources scoped to persistent owners while including stateless companions in the same signed writer control journal.
func (*Runtime) BindApplicationTransferExport ¶ added in v0.54.10
BindApplicationTransferExport runs only after the selected writers' stopped state and completed snapshot were persisted by the existing backup journal. Cleanup on failure uses the same exact-container resume and settlement path.
func (*Runtime) BindApplicationTransferHold ¶ added in v0.54.10
func (*Runtime) BindApplicationTransferResume ¶ added in v0.54.10
BindApplicationTransferResume still requires a signed stopped destination outcome in the original snapshot journal before any deferred resume can run.
func (*Runtime) BindMarketplaceControl ¶ added in v0.53.13
func (r *Runtime) BindMarketplaceControl(observe func(context.Context, localbackuppolicy.MarketplaceService) (backupexec.QuiesceContainer, error), control func(localbackuppolicy.MarketplaceService, string) (backuplifecycle.RuntimeControlDriver, error), componentControl func(backuplifecycle.SnapshotQuiescedContainer, string) (backuplifecycle.RuntimeControlDriver, error)) error
BindMarketplaceControl binds only the immutable selection already held by the Plan policy. Discovery cannot widen the snapshot source.
func (*Runtime) CloseFailedSnapshotAppGroupHolds ¶ added in v0.54.10
func (r *Runtime) CloseFailedSnapshotAppGroupHolds(ctx context.Context, groups []backuplifecycle.AppGroupControl) error
Failed snapshot closure has no anchor or success receipt. The existing signed operation must first record restored/quiescent negative completion.
func (*Runtime) CloseSnapshotAppGroupHolds ¶ added in v0.54.10
func (r *Runtime) CloseSnapshotAppGroupHolds(ctx context.Context, anchor backuplifecycle.SnapshotAnchor) error
func (*Runtime) Configure ¶
func (r *Runtime) Configure(ctx context.Context, configuration backuplifecycle.RepositoryConfiguration) (backuplifecycle.RepositoryReceipt, error)
func (*Runtime) CreateSnapshot ¶
func (r *Runtime) CreateSnapshot(ctx context.Context, request backuplifecycle.RepositorySnapshotRequest) (backuplifecycle.RepositorySnapshotReceipt, error)
func (*Runtime) CreateSnapshotWithQuiescence ¶
func (r *Runtime) CreateSnapshotWithQuiescence( ctx context.Context, request backuplifecycle.RepositorySnapshotRequest, journal backuplifecycle.SnapshotQuiescence, persist func(backuplifecycle.SnapshotQuiescence) error, ) (receipt backuplifecycle.RepositorySnapshotReceipt, resultErr error)
CreateSnapshotWithQuiescence creates or resumes one native-v2 snapshot while all current writers of governed managed volumes are stopped. The lifecycle callback atomically records the exact identities before the first stop and after each resumable phase in the existing snapshot operation journal.
func (*Runtime) LookupSnapshot ¶
func (r *Runtime) LookupSnapshot(ctx context.Context, request backuplifecycle.RepositorySnapshotRequest) (backuplifecycle.RepositorySnapshotReceipt, bool, error)
func (*Runtime) RestoreSnapshot ¶
func (r *Runtime) RestoreSnapshot( ctx context.Context, request backuplifecycle.RepositoryRestoreRequest, ) (backuplifecycle.RepositoryRestoreReceipt, error)
func (*Runtime) Status ¶
func (r *Runtime) Status(ctx context.Context, scope backuplifecycle.RepositoryScope) (backuplifecycle.RepositoryStatus, error)