Documentation
¶
Index ¶
- Constants
- type Backup
- type BackupComponents
- type BackupListFilter
- type BackupMetadata
- type BackupSpec
- type BackupStatus
- type ContainerPath
- type CreateBackupRequest
- type DatabaseSpec
- type HookSpec
- type Job
- type JobStatus
- type JobTracker
- func (t *JobTracker) Cleanup(olderThan time.Duration)
- func (t *JobTracker) CreateJob(id string, jobType JobType, deploymentName string) *Job
- func (t *JobTracker) GetJob(id string) *Job
- func (t *JobTracker) ListJobs(deploymentName string, limit int) []*Job
- func (t *JobTracker) SetBackupID(id string, backupID string)
- func (t *JobTracker) SetError(id string, err error)
- func (t *JobTracker) UpdateStatus(id string, status JobStatus, progress string)
- type JobType
- type Manager
- func (m *Manager) CleanupOldBackups(deploymentName string, keepCount int) (int, error)
- func (m *Manager) CreateBackup(ctx context.Context, deploymentName string, spec *BackupSpec) (*Backup, error)
- func (m *Manager) DeleteBackup(backupID string) error
- func (m *Manager) GetBackup(backupID string) (*Backup, error)
- func (m *Manager) GetBackupPath(backupID string) (string, error)
- func (m *Manager) GetJob(jobID string) *Job
- func (m *Manager) ListBackups(filter *BackupListFilter) ([]Backup, error)
- func (m *Manager) ListJobs(deploymentName string, limit int) []*Job
- func (m *Manager) RestoreBackup(ctx context.Context, req *RestoreBackupRequest) error
- func (m *Manager) StartBackupJob(deploymentName string, spec *BackupSpec) string
- func (m *Manager) StartRestoreJob(req *RestoreBackupRequest) string
- type RestoreBackupRequest
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backup ¶
type Backup struct {
ID string `json:"id"`
DeploymentName string `json:"deployment_name"`
Status BackupStatus `json:"status"`
Size int64 `json:"size"`
Path string `json:"path"`
Components []string `json:"components"`
Error string `json:"error,omitempty"`
CreatedAt time.Time `json:"created_at"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
type BackupComponents ¶
type BackupListFilter ¶
type BackupListFilter struct {
DeploymentName string
Status BackupStatus
Limit int
Offset int
}
type BackupMetadata ¶
type BackupMetadata struct {
ID string `json:"id"`
DeploymentName string `json:"deployment_name"`
DeploymentPath string `json:"deployment_path"`
CreatedAt time.Time `json:"created_at"`
AgentVersion string `json:"agent_version"`
Components BackupComponents `json:"components"`
ContainerStates map[string]string `json:"container_states,omitempty"`
}
type BackupSpec ¶
type BackupSpec = models.BackupSpec
type BackupStatus ¶
type BackupStatus string
const ( BackupStatusPending BackupStatus = "pending" BackupStatusInProgress BackupStatus = "in_progress" BackupStatusCompleted BackupStatus = "completed" BackupStatusFailed BackupStatus = "failed" )
type ContainerPath ¶
type ContainerPath = models.ContainerBackupPath
type CreateBackupRequest ¶
type DatabaseSpec ¶
type DatabaseSpec = models.DatabaseBackupSpec
type HookSpec ¶
type HookSpec = models.BackupHookSpec
type Job ¶
type Job struct {
ID string `json:"id"`
Type JobType `json:"type"`
Status JobStatus `json:"status"`
DeploymentName string `json:"deployment_name"`
BackupID string `json:"backup_id,omitempty"`
Progress string `json:"progress,omitempty"`
Error string `json:"error,omitempty"`
StartedAt time.Time `json:"started_at"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
}
type JobTracker ¶
type JobTracker struct {
// contains filtered or unexported fields
}
func NewJobTracker ¶
func NewJobTracker() *JobTracker
func (*JobTracker) Cleanup ¶
func (t *JobTracker) Cleanup(olderThan time.Duration)
func (*JobTracker) CreateJob ¶
func (t *JobTracker) CreateJob(id string, jobType JobType, deploymentName string) *Job
func (*JobTracker) GetJob ¶
func (t *JobTracker) GetJob(id string) *Job
func (*JobTracker) ListJobs ¶
func (t *JobTracker) ListJobs(deploymentName string, limit int) []*Job
func (*JobTracker) SetBackupID ¶
func (t *JobTracker) SetBackupID(id string, backupID string)
func (*JobTracker) SetError ¶
func (t *JobTracker) SetError(id string, err error)
func (*JobTracker) UpdateStatus ¶
func (t *JobTracker) UpdateStatus(id string, status JobStatus, progress string)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) CleanupOldBackups ¶
func (*Manager) CreateBackup ¶
func (*Manager) DeleteBackup ¶
func (*Manager) ListBackups ¶
func (m *Manager) ListBackups(filter *BackupListFilter) ([]Backup, error)
func (*Manager) RestoreBackup ¶
func (m *Manager) RestoreBackup(ctx context.Context, req *RestoreBackupRequest) error
func (*Manager) StartBackupJob ¶
func (m *Manager) StartBackupJob(deploymentName string, spec *BackupSpec) string
func (*Manager) StartRestoreJob ¶
func (m *Manager) StartRestoreJob(req *RestoreBackupRequest) string
Click to show internal directories.
Click to hide internal directories.