Documentation ¶
Index ¶
- Constants
- func BuildExitCode(errs Error) int
- func ConvertErrors(errs []error) error
- func NewJobPostFailedBackupUnlockExecutable(job Job) executor.Executable
- func NewJobPostRestoreUnlockExecutable(job Job) executor.Executable
- func NewJobPostSuccessfulBackupUnlockExecutable(job Job) executor.Executable
- func NewJobPreBackupLockExecutable(job Job) executor.Executable
- func NewJobPreRestoreLockExecutable(job Job) executor.Executable
- func Reverse(jobsSliceOfSlices [][]Job) [][]Job
- type AddFinishTimeStep
- type ArtifactCopier
- type ArtifactDirError
- type ArtifactIdentifier
- type AuthInfo
- type Backup
- type BackupArtifact
- type BackupChecker
- type BackupChecksum
- type BackupCleaner
- type BackupDownloadExecutable
- type BackupError
- type BackupExecutable
- type BackupManager
- type BackupStep
- type BackupUploadExecutable
- type BackupableStep
- type Backuper
- type CleanupError
- type CleanupPreviousStep
- type CleanupStep
- type CopyToRemoteStep
- type CreateArtifactStep
- type Deployment
- type DeploymentManager
- type DrainError
- type DrainStep
- type Error
- func (err Error) ContainsArtifactDirError() bool
- func (err Error) ContainsUnlockOrCleanupOrArtifactDirExists() bool
- func (err Error) Error() string
- func (err Error) IsCleanup() bool
- func (err Error) IsFatal() bool
- func (err Error) IsNil() bool
- func (err Error) IsPostBackup() bool
- func (err Error) PrettyError(includeStacktrace bool) string
- type FindDeploymentStep
- type Instance
- type InstanceIdentifer
- type Job
- type JobPostBackupUnlockExecutor
- type JobPostRestoreUnlockExecutor
- type JobPreBackupLockExecutor
- type JobPreRestoreLockExecutor
- type JobSpecifier
- type Jobs
- type LockError
- type LockOrderer
- type LockStep
- type Logger
- type Node
- type PostBackupUnlockStep
- type PostRestoreUnlockStep
- type PreRestoreLockStep
- type RestorableStep
- type RestoreCleaner
- type RestoreStep
- type Restorer
- type Session
- func (session *Session) CurrentArtifact() Backup
- func (session *Session) CurrentArtifactPath() string
- func (session *Session) CurrentDeployment() Deployment
- func (session *Session) DeploymentName() string
- func (session *Session) SetCurrentArtifact(artifact Backup)
- func (session *Session) SetCurrentArtifactPath(artifactPath string)
- func (session *Session) SetCurrentDeployment(deployment Deployment)
- type SkipStep
- type Step
- func NewAddFinishTimeStep(nowFunc func() time.Time) Step
- func NewBackupStep(executor executor.Executor) Step
- func NewBackupableStep(lockOrderer LockOrderer, logger Logger) Step
- func NewCleanupPreviousStep() Step
- func NewCleanupStep() Step
- func NewCopyToRemoteStep(artifactCopier ArtifactCopier) Step
- func NewCreateArtifactStep(logger Logger, backupManager BackupManager, ...) Step
- func NewDrainStep(logger Logger, artifactCopier ArtifactCopier) Step
- func NewFindDeploymentStep(deploymentManager DeploymentManager, logger Logger) Step
- func NewLockStep(lockOrderer LockOrderer, executor executor.Executor) Step
- func NewPostBackupUnlockStep(afterSuccessfulBackup bool, lockOrderer LockOrderer, ...) Step
- func NewPostRestoreUnlockStep(lockOrderer LockOrderer, executor executor.Executor) Step
- func NewPreRestoreLockStep(lockOrderer LockOrderer, executor executor.Executor) Step
- func NewRestorableStep(lockOrderer LockOrderer, logger Logger) Step
- func NewRestoreStep(logger Logger) Step
- func NewValidateArtifactStep(logger Logger, backupManager BackupManager) Step
- type UnlockError
- type ValidateArtifactStep
- type Workflow
Constants ¶
View Source
const ArtifactDirectory = "/var/vcap/store/bbr-backup"
Variables ¶
This section is empty.
Functions ¶
func BuildExitCode ¶
func ConvertErrors ¶
func NewJobPostFailedBackupUnlockExecutable ¶
func NewJobPostFailedBackupUnlockExecutable(job Job) executor.Executable
func NewJobPostRestoreUnlockExecutable ¶
func NewJobPostRestoreUnlockExecutable(job Job) executor.Executable
func NewJobPostSuccessfulBackupUnlockExecutable ¶
func NewJobPostSuccessfulBackupUnlockExecutable(job Job) executor.Executable
func NewJobPreBackupLockExecutable ¶
func NewJobPreBackupLockExecutable(job Job) executor.Executable
func NewJobPreRestoreLockExecutable ¶
func NewJobPreRestoreLockExecutable(job Job) executor.Executable
Types ¶
type AddFinishTimeStep ¶
type AddFinishTimeStep struct {
// contains filtered or unexported fields
}
func (*AddFinishTimeStep) Run ¶
func (s *AddFinishTimeStep) Run(session *Session) error
type ArtifactCopier ¶
type ArtifactCopier interface { DownloadBackupFromDeployment(Backup, Deployment) error UploadBackupToDeployment(Backup, Deployment) error }
func NewArtifactCopier ¶
func NewArtifactCopier(executor executor.Executor, logger Logger) ArtifactCopier
type ArtifactDirError ¶
type ArtifactDirError customError
func NewArtifactDirError ¶
func NewArtifactDirError(errorMessage string) ArtifactDirError
type ArtifactIdentifier ¶
type Backup ¶
type Backup interface { GetArtifactSize(ArtifactIdentifier) (string, error) GetArtifactByteSize(ArtifactIdentifier) (int, error) CreateArtifact(ArtifactIdentifier) (io.WriteCloser, error) ReadArtifact(ArtifactIdentifier) (io.ReadCloser, error) AddChecksum(ArtifactIdentifier, BackupChecksum) error CreateMetadataFileWithStartTime(time.Time) error AddFinishTime(time.Time) error FetchChecksum(ArtifactIdentifier) (BackupChecksum, error) CalculateChecksum(ArtifactIdentifier) (BackupChecksum, error) DeploymentMatches(string, []Instance) (bool, error) SaveManifest(manifest string) error Valid() (bool, error) }
type BackupArtifact ¶
type BackupChecker ¶
type BackupChecker struct {
*Workflow
}
func NewBackupChecker ¶
func NewBackupChecker(logger Logger, deploymentManager DeploymentManager, lockOrderer LockOrderer) *BackupChecker
func (BackupChecker) Check ¶
func (b BackupChecker) Check(deploymentName string) Error
type BackupChecksum ¶
func (BackupChecksum) Match ¶
func (b BackupChecksum) Match(other BackupChecksum) (bool, []string)
type BackupCleaner ¶
func NewBackupCleaner ¶
func NewBackupCleaner(logger Logger, deploymentManager DeploymentManager, lockOrderer LockOrderer, executor executor.Executor) *BackupCleaner
func (BackupCleaner) Cleanup ¶
func (c BackupCleaner) Cleanup(deploymentName string) Error
type BackupDownloadExecutable ¶
type BackupDownloadExecutable struct { Logger // contains filtered or unexported fields }
func NewBackupDownloadExecutable ¶
func NewBackupDownloadExecutable(localBackup Backup, remoteArtifact BackupArtifact, logger Logger) BackupDownloadExecutable
func (BackupDownloadExecutable) Execute ¶
func (e BackupDownloadExecutable) Execute() error
type BackupError ¶
type BackupError customError
func NewBackupError ¶
func NewBackupError(errorMessage string) BackupError
type BackupExecutable ¶
type BackupExecutable struct {
Job
}
func NewBackupExecutable ¶
func NewBackupExecutable(j Job) BackupExecutable
func (BackupExecutable) Execute ¶
func (e BackupExecutable) Execute() error
type BackupManager ¶
type BackupStep ¶
type BackupStep struct {
// contains filtered or unexported fields
}
func (*BackupStep) Run ¶
func (s *BackupStep) Run(session *Session) error
type BackupUploadExecutable ¶
type BackupUploadExecutable struct { Logger // contains filtered or unexported fields }
func NewBackupUploadExecutable ¶
func NewBackupUploadExecutable(localBackup Backup, remoteArtifact BackupArtifact, instance Instance, logger Logger) BackupUploadExecutable
func (BackupUploadExecutable) Execute ¶
func (e BackupUploadExecutable) Execute() error
type BackupableStep ¶
type BackupableStep struct {
// contains filtered or unexported fields
}
func (*BackupableStep) Run ¶
func (s *BackupableStep) Run(session *Session) error
type Backuper ¶
type Backuper struct {
// contains filtered or unexported fields
}
func NewBackuper ¶
func NewBackuper(backupManager BackupManager, logger Logger, deploymentManager DeploymentManager, lockOrderer LockOrderer, executor exe.Executor, nowFunc func() time.Time, artifactCopier ArtifactCopier, unsafeLockFree bool, timestamp string) *Backuper
type CleanupError ¶
type CleanupError customError
func NewCleanupError ¶
func NewCleanupError(errorMessage string) CleanupError
type CleanupPreviousStep ¶
type CleanupPreviousStep struct{}
func (*CleanupPreviousStep) Run ¶
func (s *CleanupPreviousStep) Run(session *Session) error
type CleanupStep ¶
type CleanupStep struct{}
func (*CleanupStep) Run ¶
func (s *CleanupStep) Run(session *Session) error
type CopyToRemoteStep ¶
type CopyToRemoteStep struct {
// contains filtered or unexported fields
}
func (*CopyToRemoteStep) Run ¶
func (s *CopyToRemoteStep) Run(session *Session) error
type CreateArtifactStep ¶
type CreateArtifactStep struct {
// contains filtered or unexported fields
}
func (*CreateArtifactStep) Run ¶
func (s *CreateArtifactStep) Run(session *Session) error
type Deployment ¶
type Deployment interface { IsBackupable() bool BackupableInstances() []Instance CheckArtifactDir() error IsRestorable() bool RestorableInstances() []Instance PreBackupLock(LockOrderer, executor.Executor) error Backup(executor.Executor) error PostBackupUnlock(bool, LockOrderer, executor.Executor) error Restore() error Cleanup() error CleanupPrevious() error Instances() []Instance PreRestoreLock(LockOrderer, executor.Executor) error PostRestoreUnlock(LockOrderer, executor.Executor) error ValidateLockingDependencies(orderer LockOrderer) error }
func NewDeployment ¶
func NewDeployment(logger Logger, instancesArray []Instance) Deployment
type DeploymentManager ¶
type DrainError ¶ added in v1.7.2
type DrainError customError
func NewDrainError ¶ added in v1.7.2
func NewDrainError(errorMessage string) DrainError
type Error ¶
type Error []error
func (Error) ContainsArtifactDirError ¶
func (Error) ContainsUnlockOrCleanupOrArtifactDirExists ¶
func (Error) IsPostBackup ¶
func (Error) PrettyError ¶
type FindDeploymentStep ¶
type FindDeploymentStep struct {
// contains filtered or unexported fields
}
func (*FindDeploymentStep) Run ¶
func (s *FindDeploymentStep) Run(session *Session) error
type Instance ¶
type Instance interface { InstanceIdentifer IsBackupable() bool ArtifactDirExists() (bool, error) ArtifactDirCreated() bool MarkArtifactDirCreated() IsRestorable() bool Backup() error Restore() error Cleanup() error CleanupPrevious() error ArtifactsToBackup() []BackupArtifact ArtifactsToRestore() []BackupArtifact HasMetadataRestoreNames() bool Jobs() []Job }
type InstanceIdentifer ¶
type Job ¶
type Job interface { HasBackup() bool HasRestore() bool HasNamedBackupArtifact() bool HasNamedRestoreArtifact() bool BackupArtifactName() string RestoreArtifactName() string HasMetadataRestoreName() bool Backup() error PreBackupLock() error PostBackupUnlock(afterSuccessfulBackup bool) error PreRestoreLock() error Restore() error PostRestoreUnlock() error Name() string Release() string InstanceIdentifier() string BackupArtifactDirectory() string RestoreArtifactDirectory() string BackupShouldBeLockedBefore() []JobSpecifier RestoreShouldBeLockedBefore() []JobSpecifier }
type JobPostBackupUnlockExecutor ¶
type JobPostBackupUnlockExecutor struct { Job // contains filtered or unexported fields }
func (JobPostBackupUnlockExecutor) Execute ¶
func (j JobPostBackupUnlockExecutor) Execute() error
type JobPostRestoreUnlockExecutor ¶
type JobPostRestoreUnlockExecutor struct {
Job
}
func (JobPostRestoreUnlockExecutor) Execute ¶
func (j JobPostRestoreUnlockExecutor) Execute() error
type JobPreBackupLockExecutor ¶
type JobPreBackupLockExecutor struct {
Job
}
func (JobPreBackupLockExecutor) Execute ¶
func (j JobPreBackupLockExecutor) Execute() error
type JobPreRestoreLockExecutor ¶
type JobPreRestoreLockExecutor struct {
Job
}
func (JobPreRestoreLockExecutor) Execute ¶
func (j JobPreRestoreLockExecutor) Execute() error
type JobSpecifier ¶
type Jobs ¶
type Jobs []Job
func (Jobs) AnyAreBackupable ¶
func (Jobs) AnyAreRestorable ¶
func (Jobs) Backupable ¶
func (Jobs) CustomRestoreArtifactNames ¶
func (Jobs) HasMetadataRestoreNames ¶
func (Jobs) Restorable ¶
type LockOrderer ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) OnSuccessOrFailure ¶
type PostBackupUnlockStep ¶
type PostBackupUnlockStep struct {
// contains filtered or unexported fields
}
func (*PostBackupUnlockStep) Run ¶
func (s *PostBackupUnlockStep) Run(session *Session) error
type PostRestoreUnlockStep ¶
type PostRestoreUnlockStep struct {
// contains filtered or unexported fields
}
func (*PostRestoreUnlockStep) Run ¶
func (s *PostRestoreUnlockStep) Run(session *Session) error
type PreRestoreLockStep ¶
type PreRestoreLockStep struct {
// contains filtered or unexported fields
}
func (*PreRestoreLockStep) Run ¶
func (s *PreRestoreLockStep) Run(session *Session) error
type RestorableStep ¶
type RestorableStep struct {
// contains filtered or unexported fields
}
func (*RestorableStep) Run ¶
func (s *RestorableStep) Run(session *Session) error
type RestoreCleaner ¶
func NewRestoreCleaner ¶
func NewRestoreCleaner(logger Logger, deploymentManager DeploymentManager, lockOrderer LockOrderer, executor executor.Executor) *RestoreCleaner
func (RestoreCleaner) Cleanup ¶
func (c RestoreCleaner) Cleanup(deploymentName string) Error
type RestoreStep ¶
type RestoreStep struct {
// contains filtered or unexported fields
}
func (*RestoreStep) Run ¶
func (s *RestoreStep) Run(session *Session) error
type Restorer ¶
type Restorer struct {
// contains filtered or unexported fields
}
func NewRestorer ¶
func NewRestorer(backupManager BackupManager, logger Logger, deploymentManager DeploymentManager, lockOrderer LockOrderer, executor executor.Executor, artifactCopier ArtifactCopier) *Restorer
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func (*Session) CurrentArtifact ¶
func (*Session) CurrentArtifactPath ¶
func (*Session) CurrentDeployment ¶
func (session *Session) CurrentDeployment() Deployment
func (*Session) DeploymentName ¶
func (*Session) SetCurrentArtifact ¶
func (*Session) SetCurrentArtifactPath ¶
func (*Session) SetCurrentDeployment ¶
func (session *Session) SetCurrentDeployment(deployment Deployment)
type SkipStep ¶ added in v1.9.1
type SkipStep struct {
// contains filtered or unexported fields
}
func NewSkipStep ¶ added in v1.9.1
type Step ¶
func NewAddFinishTimeStep ¶
func NewBackupStep ¶
func NewBackupableStep ¶
func NewBackupableStep(lockOrderer LockOrderer, logger Logger) Step
func NewCleanupPreviousStep ¶
func NewCleanupPreviousStep() Step
func NewCleanupStep ¶
func NewCleanupStep() Step
func NewCopyToRemoteStep ¶
func NewCopyToRemoteStep(artifactCopier ArtifactCopier) Step
func NewCreateArtifactStep ¶
func NewCreateArtifactStep(logger Logger, backupManager BackupManager, deploymentManager DeploymentManager, nowFunc func() time.Time, timeStamp string) Step
func NewDrainStep ¶
func NewDrainStep(logger Logger, artifactCopier ArtifactCopier) Step
func NewFindDeploymentStep ¶
func NewFindDeploymentStep(deploymentManager DeploymentManager, logger Logger) Step
func NewLockStep ¶
func NewLockStep(lockOrderer LockOrderer, executor executor.Executor) Step
func NewPostBackupUnlockStep ¶
func NewPostBackupUnlockStep(afterSuccessfulBackup bool, lockOrderer LockOrderer, executor executor.Executor) Step
func NewPostRestoreUnlockStep ¶
func NewPostRestoreUnlockStep(lockOrderer LockOrderer, executor executor.Executor) Step
func NewPreRestoreLockStep ¶
func NewPreRestoreLockStep(lockOrderer LockOrderer, executor executor.Executor) Step
func NewRestorableStep ¶
func NewRestorableStep(lockOrderer LockOrderer, logger Logger) Step
func NewRestoreStep ¶
func NewValidateArtifactStep ¶
func NewValidateArtifactStep(logger Logger, backupManager BackupManager) Step
type UnlockError ¶
type UnlockError customError
func NewPostUnlockError ¶
func NewPostUnlockError(errorMessage string) UnlockError
type ValidateArtifactStep ¶
type ValidateArtifactStep struct {
// contains filtered or unexported fields
}
func (*ValidateArtifactStep) Run ¶
func (s *ValidateArtifactStep) Run(session *Session) error
type Workflow ¶
func NewWorkflow ¶
func NewWorkflow() *Workflow
Source Files ¶
- add_finish_time_step.go
- artifact.go
- artifact_copier.go
- backup_checker.go
- backup_cleaner.go
- backup_download_executable.go
- backup_executable.go
- backup_step.go
- backup_upload_executable.go
- backupable_step.go
- backuper.go
- checksum.go
- cleanup_previous_step.go
- cleanup_step.go
- copy_to_remote_step.go
- create_artifact_step.go
- deployment.go
- deployment_manager.go
- drain_step.go
- error.go
- find_deployment_step.go
- instance.go
- job_executables.go
- jobs.go
- lock_step.go
- logger.go
- post_backup_unlock_step.go
- post_restore_unlock_step.go
- pre_restore_lock_step.go
- restorable_step.go
- restore_cleaner.go
- restore_step.go
- restorer.go
- reverse.go
- session.go
- skip_step.go
- validate_artifact_step.go
- workflow.go
Click to show internal directories.
Click to hide internal directories.