instance

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Logger
	// contains filtered or unexported fields
}

func NewBackupArtifact

func NewBackupArtifact(job orchestrator.Job, instance orchestrator.InstanceIdentifer, remoteRunner ssh.RemoteRunner, logger Logger) *Artifact

func NewRestoreArtifact

func NewRestoreArtifact(job orchestrator.Job, instance orchestrator.InstanceIdentifer, remoteRunner ssh.RemoteRunner, logger Logger) *Artifact

func (*Artifact) Checksum

func (b *Artifact) Checksum() (orchestrator.BackupChecksum, error)

func (*Artifact) Delete

func (b *Artifact) Delete() error

func (*Artifact) HasCustomName

func (b *Artifact) HasCustomName() bool

func (*Artifact) InstanceIndex

func (b *Artifact) InstanceIndex() string

func (*Artifact) InstanceName

func (b *Artifact) InstanceName() string

func (*Artifact) Name

func (b *Artifact) Name() string

func (*Artifact) Size

func (b *Artifact) Size() (string, error)

func (*Artifact) StreamFromRemote

func (b *Artifact) StreamFromRemote(writer io.Writer) error

func (*Artifact) StreamToRemote

func (b *Artifact) StreamToRemote(reader io.Reader) error

type BackupAndRestoreScripts

type BackupAndRestoreScripts []Script

func NewBackupAndRestoreScripts

func NewBackupAndRestoreScripts(files []string) BackupAndRestoreScripts

func (BackupAndRestoreScripts) BackupOnly

func (BackupAndRestoreScripts) HasBackup

func (s BackupAndRestoreScripts) HasBackup() bool

func (BackupAndRestoreScripts) MetadataOnly

func (BackupAndRestoreScripts) PostBackupUnlockOnly

func (s BackupAndRestoreScripts) PostBackupUnlockOnly() BackupAndRestoreScripts

func (BackupAndRestoreScripts) PreBackupLockOnly

func (s BackupAndRestoreScripts) PreBackupLockOnly() BackupAndRestoreScripts

func (BackupAndRestoreScripts) PreRestoreLockOnly added in v1.1.0

func (s BackupAndRestoreScripts) PreRestoreLockOnly() BackupAndRestoreScripts

func (BackupAndRestoreScripts) RestoreOnly

func (BackupAndRestoreScripts) SinglePostRestoreUnlockScript added in v1.0.0

func (s BackupAndRestoreScripts) SinglePostRestoreUnlockScript() Script

type DeployedInstance

type DeployedInstance struct {
	Logger
	// contains filtered or unexported fields
}

func NewDeployedInstance

func NewDeployedInstance(instanceIndex string, instanceGroupName string, instanceID string, artifactDirCreated bool, remoteRunner ssh.RemoteRunner, logger Logger, jobs orchestrator.Jobs) *DeployedInstance

func (*DeployedInstance) ArtifactDirCreated

func (i *DeployedInstance) ArtifactDirCreated() bool

func (*DeployedInstance) ArtifactDirExists

func (i *DeployedInstance) ArtifactDirExists() (bool, error)

func (*DeployedInstance) ArtifactsToBackup

func (i *DeployedInstance) ArtifactsToBackup() []orchestrator.BackupArtifact

func (*DeployedInstance) ArtifactsToRestore

func (i *DeployedInstance) ArtifactsToRestore() []orchestrator.BackupArtifact

func (*DeployedInstance) Backup

func (i *DeployedInstance) Backup() error

func (*DeployedInstance) ConnectedUsername added in v1.1.4

func (i *DeployedInstance) ConnectedUsername() string

func (*DeployedInstance) CustomBackupArtifactNames

func (i *DeployedInstance) CustomBackupArtifactNames() []string

func (*DeployedInstance) CustomRestoreArtifactNames

func (i *DeployedInstance) CustomRestoreArtifactNames() []string

func (*DeployedInstance) ID

func (i *DeployedInstance) ID() string

func (*DeployedInstance) Index

func (i *DeployedInstance) Index() string

func (*DeployedInstance) IsBackupable added in v1.0.0

func (i *DeployedInstance) IsBackupable() bool

func (*DeployedInstance) IsRestorable

func (i *DeployedInstance) IsRestorable() bool

func (*DeployedInstance) Jobs added in v1.1.0

func (i *DeployedInstance) Jobs() []orchestrator.Job

func (*DeployedInstance) MarkArtifactDirCreated

func (i *DeployedInstance) MarkArtifactDirCreated()

func (*DeployedInstance) Name

func (i *DeployedInstance) Name() string

func (*DeployedInstance) RemoveArtifactDir added in v1.1.4

func (i *DeployedInstance) RemoveArtifactDir() error

func (*DeployedInstance) Restore

func (i *DeployedInstance) Restore() error

type InstanceIdentifier added in v1.1.0

type InstanceIdentifier struct {
	InstanceGroupName string
	InstanceId        string
}

func (InstanceIdentifier) String added in v1.1.0

func (i InstanceIdentifier) String() string

type Job

type Job struct {
	Logger Logger
	// contains filtered or unexported fields
}

func NewJob

func NewJob(remoteRunner ssh.RemoteRunner, instanceIdentifier string, logger Logger, release string,
	jobScripts BackupAndRestoreScripts, metadata Metadata) Job

func (Job) Backup added in v1.0.0

func (j Job) Backup() error

func (Job) BackupArtifactDirectory

func (j Job) BackupArtifactDirectory() string

func (Job) BackupArtifactName

func (j Job) BackupArtifactName() string

func (Job) BackupShouldBeLockedBefore added in v1.1.0

func (j Job) BackupShouldBeLockedBefore() []orchestrator.JobSpecifier

func (Job) HasBackup

func (j Job) HasBackup() bool

func (Job) HasNamedBackupArtifact

func (j Job) HasNamedBackupArtifact() bool

func (Job) HasNamedRestoreArtifact

func (j Job) HasNamedRestoreArtifact() bool

func (Job) HasRestore

func (j Job) HasRestore() bool

func (Job) InstanceIdentifier added in v1.1.0

func (j Job) InstanceIdentifier() string

func (Job) Name

func (j Job) Name() string

func (Job) PostBackupUnlock added in v1.0.0

func (j Job) PostBackupUnlock() error

func (Job) PostRestoreUnlock added in v1.0.0

func (j Job) PostRestoreUnlock() error

func (Job) PreBackupLock added in v1.0.0

func (j Job) PreBackupLock() error

func (Job) PreRestoreLock added in v1.1.0

func (j Job) PreRestoreLock() error

func (Job) Release added in v1.1.0

func (j Job) Release() string

func (Job) Restore added in v1.0.0

func (j Job) Restore() error

func (Job) RestoreArtifactDirectory

func (j Job) RestoreArtifactDirectory() string

func (Job) RestoreArtifactName

func (j Job) RestoreArtifactName() string

func (Job) RestoreScript

func (j Job) RestoreScript() Script

func (Job) RestoreShouldBeLockedBefore added in v1.1.0

func (j Job) RestoreShouldBeLockedBefore() []orchestrator.JobSpecifier

type JobFinder

type JobFinder interface {
	FindJobs(instanceIdentifier InstanceIdentifier, remoteRunner ssh.RemoteRunner, releaseMapping ReleaseMapping) (orchestrator.Jobs, error)
}

type JobFinderFromScripts

type JobFinderFromScripts struct {
	Logger Logger
}

func NewJobFinder

func NewJobFinder(logger Logger) *JobFinderFromScripts

func (*JobFinderFromScripts) FindJobs

func (j *JobFinderFromScripts) FindJobs(instanceIdentifier InstanceIdentifier, remoteRunner ssh.RemoteRunner,
	releaseMapping ReleaseMapping) (orchestrator.Jobs, error)

type LockBefore added in v1.1.0

type LockBefore struct {
	JobName string `yaml:"job_name"`
	Release string `yaml:"release"`
}

func (LockBefore) Validate added in v1.1.0

func (l LockBefore) Validate() error

type Logger

type Logger interface {
	Debug(tag, msg string, args ...interface{})
	Info(tag, msg string, args ...interface{})
	Warn(tag, msg string, args ...interface{})
	Error(tag, msg string, args ...interface{})
}

type Metadata

type Metadata struct {
	BackupName                  string       `yaml:"backup_name"`
	RestoreName                 string       `yaml:"restore_name"`
	BackupShouldBeLockedBefore  []LockBefore `yaml:"backup_should_be_locked_before"`
	RestoreShouldBeLockedBefore []LockBefore `yaml:"restore_should_be_locked_before"`
}

func ParseJobMetadata added in v1.1.0

func ParseJobMetadata(data string) (*Metadata, error)

type ReleaseMapping added in v1.1.0

type ReleaseMapping interface {
	FindReleaseName(instanceGroupName, jobName string) (string, error)
}

func NewNoopReleaseMapping added in v1.1.4

func NewNoopReleaseMapping() ReleaseMapping

type ReleaseMappingFinder added in v1.1.0

type ReleaseMappingFinder func(manifest string) (ReleaseMapping, error)

type Script

type Script string

func (Script) JobName

func (s Script) JobName() string

func (Script) Name

func (script Script) Name() string

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL