restore

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

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