instance

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2017 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 {
	SSHConnection
	Logger
	// contains filtered or unexported fields
}

func NewBackupArtifact

func NewBackupArtifact(job Job, instance orchestrator.InstanceIdentifer, sshConn SSHConnection, logger Logger) *Artifact

func NewRestoreArtifact

func NewRestoreArtifact(job Job, instance orchestrator.InstanceIdentifer, sshConn SSHConnection, 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) RestoreOnly

type DeployedInstance

type DeployedInstance struct {
	ssh.SSHConnection
	Logger
	Jobs
	// contains filtered or unexported fields
}

func NewDeployedInstance

func NewDeployedInstance(instanceIndex string, instanceGroupName string, instanceID string, artifactDirCreated bool, connection ssh.SSHConnection, logger Logger, jobs Jobs) *DeployedInstance

func (*DeployedInstance) ArtifactDirCreated

func (d *DeployedInstance) ArtifactDirCreated() bool

func (*DeployedInstance) ArtifactDirExists

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

func (*DeployedInstance) ArtifactsToBackup

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

func (*DeployedInstance) ArtifactsToRestore

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

func (*DeployedInstance) Backup

func (d *DeployedInstance) Backup() error

func (*DeployedInstance) CustomBackupArtifactNames

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

func (*DeployedInstance) CustomRestoreArtifactNames

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

func (*DeployedInstance) HasBackupScript

func (d *DeployedInstance) HasBackupScript() bool

func (*DeployedInstance) ID

func (d *DeployedInstance) ID() string

func (*DeployedInstance) Index

func (d *DeployedInstance) Index() string

func (*DeployedInstance) IsPostBackupUnlockable

func (d *DeployedInstance) IsPostBackupUnlockable() bool

func (*DeployedInstance) IsPreBackupLockable

func (d *DeployedInstance) IsPreBackupLockable() bool

func (*DeployedInstance) IsRestorable

func (d *DeployedInstance) IsRestorable() bool

func (*DeployedInstance) MarkArtifactDirCreated

func (d *DeployedInstance) MarkArtifactDirCreated()

func (*DeployedInstance) Name

func (d *DeployedInstance) Name() string

func (*DeployedInstance) PostBackupUnlock

func (d *DeployedInstance) PostBackupUnlock() error

func (*DeployedInstance) PreBackupLock

func (d *DeployedInstance) PreBackupLock() error

func (*DeployedInstance) Restore

func (d *DeployedInstance) Restore() error

func (*DeployedInstance) RunOnInstance

func (d *DeployedInstance) RunOnInstance(cmd, label string) ([]byte, []byte, int, error)

type Job

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

func NewJob

func NewJob(jobScripts BackupAndRestoreScripts, metadata Metadata) Job

func (Job) BackupArtifactDirectory

func (j Job) BackupArtifactDirectory() string

func (Job) BackupArtifactName

func (j Job) BackupArtifactName() string

func (Job) BackupScript

func (j Job) BackupScript() Script

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) HasPostBackup

func (j Job) HasPostBackup() bool

func (Job) HasPreBackup

func (j Job) HasPreBackup() bool

func (Job) HasRestore

func (j Job) HasRestore() bool

func (Job) Name

func (j Job) Name() string

func (Job) PostBackupScript

func (j Job) PostBackupScript() Script

func (Job) PreBackupScript

func (j Job) PreBackupScript() Script

func (Job) RestoreArtifactDirectory

func (j Job) RestoreArtifactDirectory() string

func (Job) RestoreArtifactName

func (j Job) RestoreArtifactName() string

func (Job) RestoreScript

func (j Job) RestoreScript() Script

type JobFinder

type JobFinder interface {
	FindJobs(hostIdentifier string, connection SSHConnection) (Jobs, error)
}

type JobFinderFromScripts

type JobFinderFromScripts struct {
	Logger Logger
}

func NewJobFinder

func NewJobFinder(logger Logger) *JobFinderFromScripts

func (*JobFinderFromScripts) FindJobs

func (j *JobFinderFromScripts) FindJobs(hostIdentifier string, connection SSHConnection) (Jobs, error)

type Jobs

type Jobs []Job

func NewJobs

func NewJobs(scripts BackupAndRestoreScripts, metadata map[string]Metadata) Jobs

func (Jobs) AnyAreBackupable

func (jobs Jobs) AnyAreBackupable() bool

func (Jobs) AnyArePostBackupable

func (jobs Jobs) AnyArePostBackupable() bool

func (Jobs) AnyArePreBackupable

func (jobs Jobs) AnyArePreBackupable() bool

func (Jobs) AnyAreRestorable

func (jobs Jobs) AnyAreRestorable() bool

func (Jobs) AnyNeedDefaultArtifactsForBackup

func (jobs Jobs) AnyNeedDefaultArtifactsForBackup() bool

func (Jobs) AnyNeedDefaultArtifactsForRestore

func (jobs Jobs) AnyNeedDefaultArtifactsForRestore() bool

func (Jobs) Backupable

func (jobs Jobs) Backupable() Jobs

func (Jobs) CustomBackupArtifactNames

func (jobs Jobs) CustomBackupArtifactNames() []string

func (Jobs) CustomRestoreArtifactNames

func (jobs Jobs) CustomRestoreArtifactNames() []string

func (Jobs) PostBackupable

func (jobs Jobs) PostBackupable() Jobs

func (Jobs) PreBackupable

func (jobs Jobs) PreBackupable() Jobs

func (Jobs) Restorable

func (jobs Jobs) Restorable() Jobs

type Logger

type Logger interface {
	Debug(tag, msg string, args ...interface{})
	Info(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"`
}

func NewJobMetadata

func NewJobMetadata(data []byte) (*Metadata, error)

type SSHConnection

type SSHConnection interface {
	Stream(cmd string, writer io.Writer) ([]byte, int, error)
	StreamStdin(cmd string, reader io.Reader) ([]byte, []byte, int, error)
	Run(cmd string) ([]byte, []byte, int, 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