backend

package
v0.0.0-...-ba1c585 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSVM

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

func (*AWSVM) CopyFile

func (g *AWSVM) CopyFile(infile, destination string) error

func (*AWSVM) Delete

func (g *AWSVM) Delete() error

func (*AWSVM) DeleteCommandForUser

func (g *AWSVM) DeleteCommandForUser() string

func (*AWSVM) IP

func (g *AWSVM) IP() string

func (*AWSVM) Name

func (g *AWSVM) Name() string

func (*AWSVM) RunCommand

func (g *AWSVM) RunCommand(args ...string) ([]byte, error)

func (*AWSVM) RunCommandForUser

func (g *AWSVM) RunCommandForUser(args ...string) string

type AWSVMOptions

type AWSVMOptions struct {
	Region       string // region that the AWS VM will be in
	ImageID      string // note that images are specific to a region
	LoginUser    string // depends on the image being used
	InstanceType string // what VM hw configuration
	KeyDir       string // where to store the ssh key on local fs
	Dbg          DebugPrinter
	AWSBinary    string // paths to the respective commands
	SSHBinary    string
	SCPBinary    string
}

type CloudVM

type CloudVM interface {
	// Name of the VM instance that the object talks to
	Name() string

	// IP address (as a string) of the VM instance
	IP() string

	// Execute a command on the VM instance. The current directory will be the
	// working directory of the VM when the command is run.
	RunCommand(...string) (output []byte, err error)

	// Copy a file to the working directory of VM instance. The destination is treated as a
	// pathname relative to the workspace of the VM.
	CopyFile(infile, destination string) error

	// Delete the VM instance
	Delete() error

	// Provide what the user must run to run a specified command on the VM.
	RunCommandForUser(commandPlusArgs ...string) string

	// Provide the command that the user can use to delete a VM instance for which Delete()
	// was not called
	DeleteCommandForUser() string
}

func CreateCloudVM

func CreateCloudVM(instanceName string, options interface{}) (CloudVM, error)

type DebugPrinter

type DebugPrinter interface {
	Print(args ...interface{})
	Printf(fmtString string, args ...interface{})
}

DebugPrinters are used by the backends to log debugging output.

type NoopDebugPrinter

type NoopDebugPrinter struct{} // discards output

func (NoopDebugPrinter) Print

func (n NoopDebugPrinter) Print(args ...interface{})

func (NoopDebugPrinter) Printf

func (n NoopDebugPrinter) Printf(fmtString string, args ...interface{})

type SSHVM

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

func (*SSHVM) CopyFile

func (g *SSHVM) CopyFile(infile, destination string) error

func (*SSHVM) Delete

func (g *SSHVM) Delete() error

func (*SSHVM) DeleteCommandForUser

func (g *SSHVM) DeleteCommandForUser() string

func (*SSHVM) IP

func (g *SSHVM) IP() string

func (*SSHVM) Name

func (g *SSHVM) Name() string

func (*SSHVM) RunCommand

func (g *SSHVM) RunCommand(args ...string) ([]byte, error)

func (*SSHVM) RunCommandForUser

func (g *SSHVM) RunCommandForUser(args ...string) string

type SSHVMOptions

type SSHVMOptions struct {
	SSHHostIP  string   // ip of the machine to ssh to
	SSHUser    string   // username to use
	SSHOptions []string // flags to ssh command. Use this to indicate the key file, for example
	SSHBinary  string   // path to the "ssh" command
	SCPBinary  string   // path to the "scp" command
	Dbg        DebugPrinter
}

type StderrDebugPrinter

type StderrDebugPrinter struct{} // log to stderr

func (StderrDebugPrinter) Print

func (s StderrDebugPrinter) Print(args ...interface{})

func (StderrDebugPrinter) Printf

func (s StderrDebugPrinter) Printf(fmtString string, args ...interface{})

type VcloudVM

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

func (*VcloudVM) CopyFile

func (g *VcloudVM) CopyFile(infile, destination string) error

func (*VcloudVM) Delete

func (g *VcloudVM) Delete() error

func (*VcloudVM) DeleteCommandForUser

func (g *VcloudVM) DeleteCommandForUser() string

func (*VcloudVM) IP

func (g *VcloudVM) IP() string

func (*VcloudVM) Name

func (g *VcloudVM) Name() string

func (*VcloudVM) RunCommand

func (g *VcloudVM) RunCommand(args ...string) ([]byte, error)

func (*VcloudVM) RunCommandForUser

func (g *VcloudVM) RunCommandForUser(args ...string) string

type VcloudVMOptions

type VcloudVMOptions struct {
	VcloudBinary string // path to the "vcloud" command
}

Jump to

Keyboard shortcuts

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