systembackup

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: BSD-3-Clause Imports: 51 Imported by: 0

Documentation

Overview

Package systembackup owns Arcane system-recovery backup orchestration and its HTTP surface.

Index

Constants

This section is empty.

Variables

View Source
var ErrSystemBackupAlreadyRunning = errors.New("an Arcane system backup is already running")

Functions

func RegisterSystemBackups

func RegisterSystemBackups(api huma.API, service *SystemBackupService, activityService *activity.ActivityService, appCtx handlerutil.ActivityAppContext)

Types

type CreateSystemBackupInput

type CreateSystemBackupInput struct {
	Body backuptypes.CreateSystemBackupRequest
}

type DeleteSystemBackupInput

type DeleteSystemBackupInput struct {
	ID   string `path:"id"`
	Body backuptypes.DeleteSystemBackupRequest
}

type DiscoverSystemBackupsInput

type DiscoverSystemBackupsInput struct {
	Body backuptypes.DiscoverSystemBackupsRequest
}

type DiscoverSystemBackupsOutput

type DiscoverSystemBackupsOutput struct{ Body base.ApiResponse[int] }

type GenerateSystemBackupRecoveryKeyOutput

type GenerateSystemBackupRecoveryKeyOutput struct {
	Body backuptypes.SystemBackupRecoveryKey
}

type ListSystemBackupsInput

type ListSystemBackupsInput struct {
	Search string `query:"search"`
	Sort   string `query:"sort" default:"createdAt"`
	Order  string `query:"order" default:"desc"`
	Start  int    `query:"start" default:"0"`
	Limit  int    `query:"limit" default:"20"`
}

type ListSystemBackupsOutput

type ListSystemBackupsOutput struct {
	Body struct {
		Data       []backuptypes.SystemBackupRun `json:"data"`
		Pagination base.PaginationResponse       `json:"pagination"`
	}
}

type Module

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

func New

func New(service *SystemBackupService, activityService *activity.ActivityService) *Module

func (*Module) RegisterRoutes

func (m *Module) RegisterRoutes(api huma.API, appCtx handlerutil.ActivityAppContext)

func (*Module) Service

func (m *Module) Service() *SystemBackupService

type RestoreSystemBackupInput

type RestoreSystemBackupInput struct {
	ID   string `path:"id"`
	Body backuptypes.RestoreSystemBackupRequest
}

type SetSystemBackupRecoveryKeyInput

type SetSystemBackupRecoveryKeyInput struct {
	Body backuptypes.SystemBackupRecoveryKey
}

type SystemBackupHandler

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

func (*SystemBackupHandler) Create

func (*SystemBackupHandler) Delete

func (*SystemBackupHandler) Discover

func (*SystemBackupHandler) GenerateRecoveryKey

func (h *SystemBackupHandler) GenerateRecoveryKey(_ context.Context, _ *struct{}) (*GenerateSystemBackupRecoveryKeyOutput, error)

func (*SystemBackupHandler) GetPolicies

func (h *SystemBackupHandler) GetPolicies(ctx context.Context, _ *struct{}) (*SystemBackupPoliciesOutput, error)

func (*SystemBackupHandler) List

func (*SystemBackupHandler) Restore

func (*SystemBackupHandler) SetRecoveryKey

func (*SystemBackupHandler) UpdatePolicies

func (*SystemBackupHandler) Upload

type SystemBackupMessageOutput

type SystemBackupMessageOutput struct {
	Body base.ApiResponse[base.MessageResponse]
}

type SystemBackupOutput

type SystemBackupOutput struct{ Body backuptypes.SystemBackupRun }

type SystemBackupPoliciesOutput

type SystemBackupPoliciesOutput struct {
	Body backuptypes.SystemBackupPolicyCollection
}

type SystemBackupPolicy

type SystemBackupPolicy struct {
	database.BaseModel

	Enabled         bool   `gorm:"column:enabled;not null;default:false"`
	Schedule        string `gorm:"column:schedule;type:text;not null"`
	RetentionCount  int    `gorm:"column:retention_count;not null;default:7"`
	LocalEnabled    bool   `gorm:"column:local_enabled;not null;default:true"`
	S3Enabled       bool   `gorm:"column:s3_enabled;not null;default:false"`
	S3DestinationID string `gorm:"column:s3_destination_id;type:text;index"`
}

func (SystemBackupPolicy) TableName

func (SystemBackupPolicy) TableName() string

func (SystemBackupPolicy) ToDTO

type SystemBackupRecoveryConfig

type SystemBackupRecoveryConfig struct {
	database.BaseModel

	EncryptedRecoveryKey string `gorm:"column:encrypted_recovery_key;type:text;not null"`
}

func (SystemBackupRecoveryConfig) TableName

func (SystemBackupRecoveryConfig) TableName() string

type SystemBackupRecoveryKeyOutput

type SystemBackupRecoveryKeyOutput struct {
	Body backuptypes.SystemBackupRecoveryKeyStatus
}

type SystemBackupRun

type SystemBackupRun struct {
	database.BaseModel

	Size              int64                               `json:"size" gorm:"column:size" sortable:"true"`
	CreatedAt         time.Time                           `json:"createdAt" gorm:"column:created_at" sortable:"true"`
	Status            SystemBackupStatus                  `json:"status" gorm:"column:status;type:text;not null" sortable:"true"`
	Trigger           SystemBackupTrigger                 `json:"trigger" gorm:"column:trigger;type:text;not null" sortable:"true"`
	Destination       backuptypes.SystemBackupDestination `json:"destination" gorm:"column:destination;type:text;not null" sortable:"true"`
	LocalSnapshotID   string                              `json:"localSnapshotId,omitempty" gorm:"column:local_snapshot_id;type:text"`
	RemoteSnapshotID  string                              `json:"remoteSnapshotId,omitempty" gorm:"column:remote_snapshot_id;type:text"`
	S3DestinationID   string                              `json:"s3DestinationId,omitempty" gorm:"column:s3_destination_id;type:text;index"`
	S3DestinationName string                              `json:"s3DestinationName,omitempty" gorm:"-"`
	PolicyID          string                              `json:"policyId,omitempty" gorm:"column:policy_id;type:text;index"`
	Error             string                              `json:"error,omitempty" gorm:"column:error;type:text"`
}

func (SystemBackupRun) TableName

func (SystemBackupRun) TableName() string

func (SystemBackupRun) ToDTO

type SystemBackupService

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

func NewSystemBackupService

func NewSystemBackupService(db *database.DB, dockerService *docker.DockerClientService, volumeService *volume.VolumeService, engine *backup.Engine, s3Destinations *s3domain.S3DestinationService, activityService *activity.ActivityService, cfg *config.Config) *SystemBackupService

func (*SystemBackupService) CreateBackup

func (*SystemBackupService) DeleteBackup

func (s *SystemBackupService) DeleteBackup(ctx context.Context, id, recoveryKey string) error

func (*SystemBackupService) DiscoverRemoteBackups

func (s *SystemBackupService) DiscoverRemoteBackups(ctx context.Context, request backuptypes.DiscoverSystemBackupsRequest) (int, error)

func (*SystemBackupService) GenerateRecoveryKey

func (s *SystemBackupService) GenerateRecoveryKey() (*backuptypes.SystemBackupRecoveryKey, error)

func (*SystemBackupService) GetPolicies

func (*SystemBackupService) ListBackups

func (*SystemBackupService) RegisterBackupJobOnStartup

func (s *SystemBackupService) RegisterBackupJobOnStartup(ctx context.Context)

func (*SystemBackupService) RestoreBackup

func (s *SystemBackupService) RestoreBackup(ctx context.Context, id, recoveryKey string, user common.User) error

func (*SystemBackupService) SetRecoveryKey

func (*SystemBackupService) SetScheduler

func (s *SystemBackupService) SetScheduler(ctx context.Context, scheduler schedulertypes.DynamicScheduler, admissionGate *actors.Gate[actors.AdmissionKey]) error

SetScheduler injects the dynamic scheduler and admission gate for per-policy system backup jobs. Agent mode leaves them unset.

func (*SystemBackupService) SupportedDatabaseProvider

func (s *SystemBackupService) SupportedDatabaseProvider() bool

SupportedDatabaseProvider reports whether system recovery works on the configured database. Recovery is currently SQLite-only.

func (*SystemBackupService) UploadBackup

type SystemBackupStatus

type SystemBackupStatus string
const (
	SystemBackupStatusRunning   SystemBackupStatus = "running"
	SystemBackupStatusSucceeded SystemBackupStatus = "succeeded"
	SystemBackupStatusFailed    SystemBackupStatus = "failed"
)

type SystemBackupTrigger

type SystemBackupTrigger string
const (
	SystemBackupTriggerManual    SystemBackupTrigger = "manual"
	SystemBackupTriggerScheduled SystemBackupTrigger = "scheduled"
	SystemBackupTriggerSafety    SystemBackupTrigger = "safety"
)

type UpdateSystemBackupPoliciesInput

type UpdateSystemBackupPoliciesInput struct {
	Body backuptypes.UpdateSystemBackupPolicies
}

type UploadSystemBackupInput

type UploadSystemBackupInput struct {
	ID   string `path:"id"`
	Body backuptypes.UploadSystemBackupRequest
}

Jump to

Keyboard shortcuts

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