Documentation ¶
Index ¶
- Constants
- func ConvertErrors(errs []error) error
- func ProcessError(errs Error) (int, string, string)
- type ArtifactIdentifier
- type AuthInfo
- type Backup
- type BackupArtifact
- type BackupChecksum
- type BackupError
- type BackupManager
- type Backuper
- type CleanupError
- type Deployment
- type DeploymentManager
- type Error
- type Instance
- type InstanceIdentifer
- type LockError
- type Logger
- type PostBackupUnlockError
- type Restorer
Constants ¶
View Source
const ( StateReady = "ready" StateDeploymentExists = "deployment-exists" StateHasBackupScript = "is-backupable" StateArtifactCreated = "artifact-created" StateLocked = "locked" StateBackedup = "backed-up" StateUnlocked = "unlocked" StateDrained = "drained" StateFinished = "finished" )
View Source
const ( EventCheckDeployment = "check-deployment-exists" EventCheckHasBackupScript = "check-is-backupable" EventCreateEmptyLocalArtifact = "create-artifact" EventPrebackupLock = "pre-backup-lock" EventBackup = "backup" EventPostBackupUnlock = "post-backup-unlock" EventDrain = "drain" EventCleanup = "cleanup" )
View Source
const ArtifactDirectory = "/var/vcap/store/bbr-backup"
Variables ¶
This section is empty.
Functions ¶
func ConvertErrors ¶
Types ¶
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 BackupChecksum ¶
func (BackupChecksum) Match ¶
func (self BackupChecksum) Match(other BackupChecksum) bool
type BackupError ¶
type BackupError customError
func NewBackupError ¶
func NewBackupError(errorMessage string) BackupError
type BackupManager ¶
type Backuper ¶
type Backuper struct { BackupManager Logger DeploymentManager NowFunc func() time.Time }
func NewBackuper ¶
func NewBackuper(backupManager BackupManager, logger Logger, deploymentManager DeploymentManager, nowFunc func() time.Time) *Backuper
type CleanupError ¶
type CleanupError customError
func NewCleanupError ¶
func NewCleanupError(errorMessage string) CleanupError
type Deployment ¶
type Deployment interface { HasBackupScript() bool HasUniqueCustomArtifactNames() bool CheckArtifactDir() error IsRestorable() bool PreBackupLock() error Backup() error PostBackupUnlock() error Restore() error CopyRemoteBackupToLocal(Backup) error CopyLocalBackupToRemote(Backup) error Cleanup() error Instances() []Instance CustomArtifactNamesMatch() error }
func NewDeployment ¶
func NewDeployment(logger Logger, instancesArray []Instance) Deployment
type DeploymentManager ¶
type Instance ¶
type Instance interface { InstanceIdentifer HasBackupScript() bool ArtifactDirExists() (bool, error) ArtifactDirCreated() bool MarkArtifactDirCreated() IsPostBackupUnlockable() bool IsPreBackupLockable() bool IsRestorable() bool PreBackupLock() error Backup() error PostBackupUnlock() error Restore() error Cleanup() error ArtifactsToBackup() []BackupArtifact ArtifactsToRestore() []BackupArtifact CustomBackupArtifactNames() []string CustomRestoreArtifactNames() []string }
type InstanceIdentifer ¶
type PostBackupUnlockError ¶
type PostBackupUnlockError customError
func NewPostBackupUnlockError ¶
func NewPostBackupUnlockError(errorMessage string) PostBackupUnlockError
type Restorer ¶
type Restorer struct { BackupManager Logger DeploymentManager }
func NewRestorer ¶
func NewRestorer(backupManager BackupManager, logger Logger, deploymentManager DeploymentManager) *Restorer
Source Files ¶
Click to show internal directories.
Click to hide internal directories.