Documentation ¶
Overview ¶
Package migration this package holds a async service for doing some tenant related migration tasks, like backup, restore, check
Index ¶
- func MigrateBackup(tntsrv interfaces.TenantManager, stgf interfaces.StorageFactory) error
- type BackupCheck
- type CheckContext
- type CheckResultLine
- type Management
- func (m *Management) Close() error
- func (m *Management) GetResult(tenant string) (Result, error)
- func (m *Management) Init() error
- func (m *Management) IsRunning(tenant string) bool
- func (m *Management) StartCheck(tenant string) (string, error)
- func (m *Management) StartRestore(tenant string) (string, error)
- type RestoreContext
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateBackup ¶
func MigrateBackup(tntsrv interfaces.TenantManager, stgf interfaces.StorageFactory) error
MigrateBackup migrates all blobs in the main storage for all tenants into the backup storage, if not already present
Types ¶
type BackupCheck ¶
type BackupCheck struct {
Tenant string
}
BackupCheck the struct for doing a backup
type CheckContext ¶
type CheckContext struct { TenantID string CheckID string Started time.Time Finished time.Time Cache interfaces.BlobStorage Primary interfaces.BlobStorage Backup interfaces.BlobStorage Running bool Filename string BlobID string Message string // contains filtered or unexported fields }
CheckContext struct for the running check
func (*CheckContext) CheckStorage ¶
func (c *CheckContext) CheckStorage() (string, error)
CheckStorage checks the storage to find inconsistencies. It will write a audit file with a line for every blob in the storage, including name, hash, and state
func (*CheckContext) IsRunning ¶
func (c *CheckContext) IsRunning() bool
IsRunning checking if this task is running
type CheckResultLine ¶
type CheckResultLine struct { ID string Filename string InCache bool InBackup bool PrimaryHashOK bool BackupHashOK bool HasError bool Messages []string }
CheckResultLine on entry for the result of the check, usually converted into one report output line
type Management ¶
type Management struct { StorageFactory interfaces.StorageFactory // contains filtered or unexported fields }
Management this service takes control over several async migration parts, as backup, checks ...
func (*Management) GetResult ¶
func (m *Management) GetResult(tenant string) (Result, error)
GetResult getting the result of the last migration task
func (*Management) IsRunning ¶
func (m *Management) IsRunning(tenant string) bool
IsRunning checking if a migration task is running for a tenant
func (*Management) StartCheck ¶
func (m *Management) StartCheck(tenant string) (string, error)
StartCheck starting a check of all blob for a tenant
func (*Management) StartRestore ¶
func (m *Management) StartRestore(tenant string) (string, error)
StartRestore starting a restore task for a tenant
type RestoreContext ¶
type RestoreContext struct { TenantID string ID string Started time.Time Finnished time.Time Primary interfaces.BlobStorage Backup interfaces.BlobStorage Running bool // contains filtered or unexported fields }
RestoreContext struct for the running a full restore of the tenant
func MigrateRestore ¶
func MigrateRestore(tenant string, stgf interfaces.StorageFactory) (*RestoreContext, error)
MigrateRestore migrates all blobs in the backup storage for a tenant into the main storage, if not already present
func (*RestoreContext) IsRunning ¶
func (r *RestoreContext) IsRunning() bool
IsRunning checking if a full restore is running
func (*RestoreContext) Restore ¶
func (r *RestoreContext) Restore()
Restore starting a full restore of a tenant