restore

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelJobGlobal added in v1.5.5

func CancelJobGlobal(jobID uuid.UUID)

CancelJobGlobal cancels a job on the global worker instance

func CleanupExpiredExtractions

func CleanupExpiredExtractions(db *gorm.DB) error

CleanupExpiredExtractions removes old extraction jobs and their files

func CleanupExtractionJob

func CleanupExtractionJob(db *gorm.DB, jobID uuid.UUID, adminUserID uuid.UUID) error

CleanupExtractionJob cancels the extraction job immediately and cleans up

func CreateCompletedExtractionJob

func CreateCompletedExtractionJob(db *gorm.DB, adminUserID, restoreUploadID uuid.UUID, extractionPath string) (*database.RestoreExtractionJob, error)

CreateCompletedExtractionJob creates a completed extraction job with existing extracted files

func CreateExtractionJob

func CreateExtractionJob(db *gorm.DB, adminUserID, restoreUploadID uuid.UUID) (*database.RestoreExtractionJob, error)

CreateExtractionJob creates a new extraction job for a restore upload

func EnsureWorkerRunning

func EnsureWorkerRunning(db *gorm.DB)

EnsureWorkerRunning starts the extraction worker if it's not already running

func ExtractTarGzWithProgress

func ExtractTarGzWithProgress(ctx context.Context, archivePath, destDir string, progressCallback func(int, string)) error

ExtractTarGzWithProgress extracts a tar.gz archive with progress reporting

func GetExtractionJob

func GetExtractionJob(db *gorm.DB, jobID uuid.UUID, adminUserID uuid.UUID) (*database.RestoreExtractionJob, error)

GetExtractionJob retrieves an extraction job by ID

func GetExtractionJobByUpload

func GetExtractionJobByUpload(db *gorm.DB, uploadID uuid.UUID, adminUserID uuid.UUID) (*database.RestoreExtractionJob, error)

GetExtractionJobByUpload retrieves an extraction job by restore upload ID

func GetWorkerStatus

func GetWorkerStatus() map[string]interface{}

GetWorkerStatus returns the current status of the global extraction worker for debugging

Types

type ExtractionWorker

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

func NewExtractionWorker

func NewExtractionWorker(db *gorm.DB) *ExtractionWorker

func (*ExtractionWorker) CancelJob added in v1.5.5

func (w *ExtractionWorker) CancelJob(jobID uuid.UUID)

CancelJob cancels a specific extraction job by its ID

func (*ExtractionWorker) IsRunning

func (w *ExtractionWorker) IsRunning() bool

IsRunning returns true if the worker is currently running

func (*ExtractionWorker) Start

func (w *ExtractionWorker) Start()

func (*ExtractionWorker) Stop

func (w *ExtractionWorker) Stop()

type ProgressReader

type ProgressReader struct {
	Reader     io.Reader
	TotalSize  int64
	ReadBytes  int64
	OnProgress func(int, string)
}

ProgressReader wraps an io.Reader to provide progress updates

func (*ProgressReader) Read

func (pr *ProgressReader) Read(p []byte) (int, error)

Jump to

Keyboard shortcuts

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