restore

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RestorePreview

type RestorePreview struct {
	BranchID            string
	BranchName          string
	CurrentLSN          int64
	TargetLSN           int64
	OperationsToDiscard int
	AffectedCollections map[string]int // collection -> operation count
	CurrentCollections  []string
	TargetCollections   []string
}

RestorePreview contains information about what a restore would do

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides branch restore and creation from historical points

func NewService

func NewService(
	walService *wal.Service,
	branchService *branchwal.BranchService,
	materializerService *materializer.Service,
	timeTravelService *timetravel.Service,
) *Service

NewService creates a new restore service

func (*Service) CreateBranchAtLSN

func (s *Service) CreateBranchAtLSN(projectID, sourceBranchID, newBranchName string, targetLSN int64) (*wal.Branch, error)

CreateBranchAtLSN creates a new branch from a historical point

func (*Service) CreateBranchAtTime

func (s *Service) CreateBranchAtTime(projectID, sourceBranchID, newBranchName string, timestamp time.Time) (*wal.Branch, error)

CreateBranchAtTime creates a new branch from a specific timestamp

func (*Service) GetRestorePreview

func (s *Service) GetRestorePreview(branchID string, targetLSN int64) (*RestorePreview, error)

GetRestorePreview shows what a restore operation would do

func (*Service) ResetBranchToLSN

func (s *Service) ResetBranchToLSN(branchID string, targetLSN int64) (*wal.Branch, error)

ResetBranchToLSN resets a branch to a historical LSN

func (*Service) ResetBranchToTime

func (s *Service) ResetBranchToTime(branchID string, timestamp time.Time) (*wal.Branch, error)

ResetBranchToTime resets a branch to a specific timestamp

func (*Service) ValidateRestore

func (s *Service) ValidateRestore(branchID string, targetLSN int64) error

ValidateRestore checks if a restore operation is safe

Jump to

Keyboard shortcuts

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