Documentation ¶
Index ¶
- Constants
- func BuildExitCode(errs Error) int
- func ConvertErrors(errs []error) error
- func JobPostBackupUnlocker(job Job) error
- func JobPostRestoreUnlocker(job Job) error
- func JobPreBackupLocker(job Job) error
- func JobPreRestoreLocker(job Job) error
- func Reverse(jobsSliceOfSlices [][]Job) [][]Job
- type AddFinishTimeStep
- type ArtifactIdentifier
- type AuthInfo
- type Backup
- type BackupArtifact
- type BackupChecker
- type BackupChecksum
- type BackupCleaner
- type BackupError
- type BackupManager
- type BackupStep
- type BackupableStep
- type Backuper
- type CleanupError
- type CleanupPreviousStep
- type CleanupStep
- type CopyToRemoteStep
- type CreateArtifactStep
- type Deployment
- type DeploymentManager
- type DrainStep
- type Error
- func (err Error) ContainsUnlockOrCleanup() bool
- func (e Error) Error() string
- func (e Error) IsCleanup() bool
- func (e Error) IsFatal() bool
- func (e Error) IsNil() bool
- func (err Error) IsPostBackup() bool
- func (e Error) Join(otherError Error) Error
- func (e Error) PrettyError(includeStacktrace bool) string
- type FindDeploymentStep
- type Instance
- type InstanceIdentifer
- type Job
- type JobExecutionStrategy
- 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 Step
- func NewAddFinishTimeStep(nowFunc func() time.Time) Step
- func NewBackupStep() Step
- func NewBackupableStep(lockOrderer LockOrderer, logger Logger) Step
- func NewCleanupPreviousStep() Step
- func NewCleanupStep() Step
- func NewCopyToRemoteStep() Step
- func NewCreateArtifactStep(logger Logger, backupManager BackupManager, ...) Step
- func NewDrainStep(logger Logger) Step
- func NewFindDeploymentStep(deploymentManager DeploymentManager, logger Logger) Step
- func NewLockStep(lockOrderer LockOrderer, jobExecutionStategy JobExecutionStrategy) Step
- func NewPostBackupUnlockStep(lockOrderer LockOrderer, jobExecutionStategy JobExecutionStrategy) Step
- func NewPostRestoreUnlockStep(lockOrderer LockOrderer, jobExecutionStategy JobExecutionStrategy) Step
- func NewPreRestoreLockStep(lockOrderer LockOrderer, jobExecutionStategy JobExecutionStrategy) Step
- func NewRestorableStep(lockOrderer LockOrderer) 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 ¶ added in v1.1.4
func ConvertErrors ¶
func JobPostBackupUnlocker ¶ added in v1.1.6
func JobPostRestoreUnlocker ¶ added in v1.1.6
func JobPreBackupLocker ¶ added in v1.1.6
func JobPreRestoreLocker ¶ added in v1.1.6
Types ¶
type AddFinishTimeStep ¶ added in v1.1.0
type AddFinishTimeStep struct {
// contains filtered or unexported fields
}
func (*AddFinishTimeStep) Run ¶ added in v1.1.0
func (s *AddFinishTimeStep) Run(session *Session) error
type ArtifactIdentifier ¶
type Backup ¶
type Backup interface { 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 ¶ added in v1.1.0
type BackupChecker struct {
*Workflow
}
func NewBackupChecker ¶ added in v1.1.0
func NewBackupChecker(logger Logger, deploymentManager DeploymentManager, lockOrderer LockOrderer) *BackupChecker
func (BackupChecker) CanBeBackedUp ¶ added in v1.1.0
func (b BackupChecker) CanBeBackedUp(deploymentName string) (bool, Error)
type BackupChecksum ¶
func (BackupChecksum) Match ¶
func (b BackupChecksum) Match(other BackupChecksum) (bool, []string)
type BackupCleaner ¶ added in v1.1.0
func NewBackupCleaner ¶ added in v1.1.0
func NewBackupCleaner(logger Logger, deploymentManager DeploymentManager, lockOrderer LockOrderer, jobExecutionStategy JobExecutionStrategy) *BackupCleaner
func (BackupCleaner) Cleanup ¶ added in v1.1.0
func (c BackupCleaner) Cleanup(deploymentName string) Error
type BackupError ¶
type BackupError customError
func NewBackupError ¶
func NewBackupError(errorMessage string) BackupError
type BackupManager ¶
type BackupStep ¶ added in v1.1.0
type BackupStep struct{}
func (*BackupStep) Run ¶ added in v1.1.0
func (s *BackupStep) Run(session *Session) error
type BackupableStep ¶ added in v1.1.0
type BackupableStep struct {
// contains filtered or unexported fields
}
func (*BackupableStep) Run ¶ added in v1.1.0
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, jobExecutionStategy JobExecutionStrategy, nowFunc func() time.Time) *Backuper
type CleanupError ¶
type CleanupError customError
func NewCleanupError ¶
func NewCleanupError(errorMessage string) CleanupError
type CleanupPreviousStep ¶ added in v1.1.0
type CleanupPreviousStep struct{}
func (*CleanupPreviousStep) Run ¶ added in v1.1.0
func (s *CleanupPreviousStep) Run(session *Session) error
type CleanupStep ¶ added in v1.1.0
type CleanupStep struct{}
func (*CleanupStep) Run ¶ added in v1.1.0
func (s *CleanupStep) Run(session *Session) error
type CopyToRemoteStep ¶ added in v1.1.0
type CopyToRemoteStep struct{}
func (*CopyToRemoteStep) Run ¶ added in v1.1.0
func (s *CopyToRemoteStep) Run(session *Session) error
type CreateArtifactStep ¶ added in v1.1.0
type CreateArtifactStep struct {
// contains filtered or unexported fields
}
func (*CreateArtifactStep) Run ¶ added in v1.1.0
func (s *CreateArtifactStep) Run(session *Session) error
type Deployment ¶
type Deployment interface { IsBackupable() bool HasUniqueCustomArtifactNames() bool CheckArtifactDir() error IsRestorable() bool PreBackupLock(orderer LockOrderer, jobExecutionStategy JobExecutionStrategy) error Backup() error PostBackupUnlock(orderer LockOrderer, jobExecutionStategy JobExecutionStrategy) error Restore() error CopyRemoteBackupToLocal(Backup) error CopyLocalBackupToRemote(Backup) error Cleanup() error CleanupPrevious() error Instances() []Instance CustomArtifactNamesMatch() error PreRestoreLock(orderer LockOrderer, jobExecutionStategy JobExecutionStrategy) error PostRestoreUnlock(orderer LockOrderer, jobExecutionStategy JobExecutionStrategy) error ValidateLockingDependencies(orderer LockOrderer) error }
func NewDeployment ¶
func NewDeployment(logger Logger, instancesArray []Instance) Deployment
type DeploymentManager ¶
type DrainStep ¶ added in v1.1.0
type DrainStep struct {
// contains filtered or unexported fields
}
type Error ¶
type Error []error
func (Error) ContainsUnlockOrCleanup ¶ added in v1.1.0
func (Error) IsPostBackup ¶
func (Error) PrettyError ¶
type FindDeploymentStep ¶ added in v1.1.0
type FindDeploymentStep struct {
// contains filtered or unexported fields
}
func (*FindDeploymentStep) Run ¶ added in v1.1.0
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 CustomBackupArtifactNames() []string CustomRestoreArtifactNames() []string Jobs() []Job }
type InstanceIdentifer ¶
type Job ¶ added in v1.1.0
type Job interface { HasBackup() bool HasRestore() bool HasNamedBackupArtifact() bool HasNamedRestoreArtifact() bool BackupArtifactName() string RestoreArtifactName() string Backup() error PreBackupLock() error PostBackupUnlock() error PreRestoreLock() error Restore() error PostRestoreUnlock() error Name() string Release() string InstanceIdentifier() string BackupArtifactDirectory() string RestoreArtifactDirectory() string BackupShouldBeLockedBefore() []JobSpecifier RestoreShouldBeLockedBefore() []JobSpecifier }
type JobExecutionStrategy ¶ added in v1.1.6
type JobSpecifier ¶ added in v1.1.0
type Jobs ¶ added in v1.1.0
type Jobs []Job
func (Jobs) AnyAreBackupable ¶ added in v1.1.0
func (Jobs) AnyAreRestorable ¶ added in v1.1.0
func (Jobs) Backupable ¶ added in v1.1.0
func (Jobs) CustomBackupArtifactNames ¶ added in v1.1.0
func (Jobs) CustomRestoreArtifactNames ¶ added in v1.1.0
func (Jobs) Restorable ¶ added in v1.1.0
type LockOrderer ¶ added in v1.1.0
type Node ¶ added in v1.1.0
type Node struct {
// contains filtered or unexported fields
}
func (*Node) OnSuccessOrFailure ¶ added in v1.1.0
type PostBackupUnlockStep ¶ added in v1.1.0
type PostBackupUnlockStep struct {
// contains filtered or unexported fields
}
func (*PostBackupUnlockStep) Run ¶ added in v1.1.0
func (s *PostBackupUnlockStep) Run(session *Session) error
type PostRestoreUnlockStep ¶ added in v1.1.0
type PostRestoreUnlockStep struct {
// contains filtered or unexported fields
}
func (*PostRestoreUnlockStep) Run ¶ added in v1.1.0
func (s *PostRestoreUnlockStep) Run(session *Session) error
type PreRestoreLockStep ¶ added in v1.1.0
type PreRestoreLockStep struct {
// contains filtered or unexported fields
}
func (*PreRestoreLockStep) Run ¶ added in v1.1.0
func (s *PreRestoreLockStep) Run(session *Session) error
type RestorableStep ¶ added in v1.1.0
type RestorableStep struct {
// contains filtered or unexported fields
}
func (*RestorableStep) Run ¶ added in v1.1.0
func (s *RestorableStep) Run(session *Session) error
type RestoreCleaner ¶ added in v1.1.0
func NewRestoreCleaner ¶ added in v1.1.0
func NewRestoreCleaner(logger Logger, deploymentManager DeploymentManager, lockOrderer LockOrderer, jobExecutionStategy JobExecutionStrategy) *RestoreCleaner
func (RestoreCleaner) Cleanup ¶ added in v1.1.0
func (c RestoreCleaner) Cleanup(deploymentName string) Error
type RestoreStep ¶ added in v1.1.0
type RestoreStep struct {
// contains filtered or unexported fields
}
func (*RestoreStep) Run ¶ added in v1.1.0
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, jobExecutionStategy JobExecutionStrategy) *Restorer
type Session ¶ added in v1.1.0
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶ added in v1.1.0
func (*Session) CurrentArtifact ¶ added in v1.1.0
func (*Session) CurrentArtifactPath ¶ added in v1.1.0
func (*Session) CurrentDeployment ¶ added in v1.1.0
func (session *Session) CurrentDeployment() Deployment
func (*Session) DeploymentName ¶ added in v1.1.0
func (*Session) SetCurrentArtifact ¶ added in v1.1.0
func (*Session) SetCurrentArtifactPath ¶ added in v1.1.0
func (*Session) SetCurrentDeployment ¶ added in v1.1.0
func (session *Session) SetCurrentDeployment(deployment Deployment)
type Step ¶ added in v1.1.0
func NewAddFinishTimeStep ¶ added in v1.1.0
func NewBackupStep ¶ added in v1.1.0
func NewBackupStep() Step
func NewBackupableStep ¶ added in v1.1.0
func NewBackupableStep(lockOrderer LockOrderer, logger Logger) Step
func NewCleanupPreviousStep ¶ added in v1.1.0
func NewCleanupPreviousStep() Step
func NewCleanupStep ¶ added in v1.1.0
func NewCleanupStep() Step
func NewCopyToRemoteStep ¶ added in v1.1.0
func NewCopyToRemoteStep() Step
func NewCreateArtifactStep ¶ added in v1.1.0
func NewCreateArtifactStep(logger Logger, backupManager BackupManager, deploymentManager DeploymentManager, nowFunc func() time.Time) Step
func NewDrainStep ¶ added in v1.1.0
func NewFindDeploymentStep ¶ added in v1.1.0
func NewFindDeploymentStep(deploymentManager DeploymentManager, logger Logger) Step
func NewLockStep ¶ added in v1.1.0
func NewLockStep(lockOrderer LockOrderer, jobExecutionStategy JobExecutionStrategy) Step
func NewPostBackupUnlockStep ¶ added in v1.1.0
func NewPostBackupUnlockStep(lockOrderer LockOrderer, jobExecutionStategy JobExecutionStrategy) Step
func NewPostRestoreUnlockStep ¶ added in v1.1.0
func NewPostRestoreUnlockStep(lockOrderer LockOrderer, jobExecutionStategy JobExecutionStrategy) Step
func NewPreRestoreLockStep ¶ added in v1.1.0
func NewPreRestoreLockStep(lockOrderer LockOrderer, jobExecutionStategy JobExecutionStrategy) Step
func NewRestorableStep ¶ added in v1.1.0
func NewRestorableStep(lockOrderer LockOrderer) Step
func NewRestoreStep ¶ added in v1.1.0
func NewValidateArtifactStep ¶ added in v1.1.0
func NewValidateArtifactStep(logger Logger, backupManager BackupManager) Step
type UnlockError ¶ added in v1.0.0
type UnlockError customError
func NewPostUnlockError ¶ added in v1.1.0
func NewPostUnlockError(errorMessage string) UnlockError
type ValidateArtifactStep ¶ added in v1.1.0
type ValidateArtifactStep struct {
// contains filtered or unexported fields
}
func (*ValidateArtifactStep) Run ¶ added in v1.1.0
func (s *ValidateArtifactStep) Run(session *Session) error
type Workflow ¶ added in v1.1.0
func NewWorkflow ¶ added in v1.1.0
func NewWorkflow() *Workflow
Source Files ¶
- add_finish_time_step.go
- artifact.go
- backup_checker.go
- backup_cleaner.go
- backup_step.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_execution_strategy.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
- validate_artifact_step.go
- workflow.go
Click to show internal directories.
Click to hide internal directories.