vm

package
v0.0.0-...-850ae45 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2017 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	VM(name string) (vm VM, err error)
}

type CertStore

type CertStore interface {
	Store(cert string) error
}

type Client

type Client interface {
	Status(host string, privateKey []byte) (string, error)
	ReplaceSecrets(host, password string, privateKey []byte) error
}

type CmdRunner

type CmdRunner interface {
	Run(command string, args ...string) (output []byte, err error)
}

type DestroyVMError

type DestroyVMError struct {
	Err error
}

func (*DestroyVMError) Error

func (e *DestroyVMError) Error() string

type Driver

type Driver interface {
	VBoxManage(arg ...string) (output []byte, err error)
}

type FS

type FS interface {
	Remove(path string) error
	Exists(path string) (exists bool, err error)
	Write(path string, contents io.Reader, append bool) error
	Read(path string) (contents []byte, err error)
	Compress(name string, path string, contentPaths []string) error
	TempDir() (tempDir string, err error)
}

type FetchLogsError

type FetchLogsError struct {
	Err error
}

func (*FetchLogsError) Error

func (e *FetchLogsError) Error() string

type HelpText

type HelpText interface {
	Print(domain string, autoTarget bool)
}

type ImportVMError

type ImportVMError struct {
	Err error
}

func (*ImportVMError) Error

func (e *ImportVMError) Error() string

type Invalid

type Invalid struct {
	Err error
}

func (*Invalid) GetDebugLogs

func (i *Invalid) GetDebugLogs() error

func (*Invalid) Provision

func (i *Invalid) Provision(opts *StartOpts) error

func (*Invalid) Resume

func (i *Invalid) Resume() error

func (*Invalid) SSH

func (i *Invalid) SSH() error

func (*Invalid) Start

func (i *Invalid) Start(opts *StartOpts) error

func (*Invalid) Status

func (i *Invalid) Status() string

func (*Invalid) Stop

func (i *Invalid) Stop() error

func (*Invalid) Suspend

func (i *Invalid) Suspend() error

func (*Invalid) Target

func (i *Invalid) Target(autoTarget bool) error

func (*Invalid) Trust

func (i *Invalid) Trust(startOps *StartOpts) error

func (*Invalid) VerifyStartOpts

func (i *Invalid) VerifyStartOpts(opts *StartOpts) error

type LogFetcher

type LogFetcher interface {
	FetchLogs() error
}

type Network

type Network interface {
	HasIPCollision(ip string) (bool, error)
}

type NotCreated

type NotCreated struct {
	VBox     VBox
	UI       UI
	Builder  Builder
	Config   *config.Config
	VMConfig *config.VMConfig
	FS       FS
	Network  Network
}

func (*NotCreated) GetDebugLogs

func (n *NotCreated) GetDebugLogs() error

func (*NotCreated) Provision

func (n *NotCreated) Provision(opts *StartOpts) error

func (*NotCreated) Resume

func (n *NotCreated) Resume() error

func (*NotCreated) SSH

func (n *NotCreated) SSH() error

func (*NotCreated) Start

func (n *NotCreated) Start(opts *StartOpts) error

func (*NotCreated) Status

func (n *NotCreated) Status() string

func (*NotCreated) Stop

func (n *NotCreated) Stop() error

func (*NotCreated) Suspend

func (n *NotCreated) Suspend() error

func (*NotCreated) Target

func (n *NotCreated) Target(autoTarget bool) error

func (*NotCreated) Trust

func (n *NotCreated) Trust(startOps *StartOpts) error

func (*NotCreated) VerifyStartOpts

func (n *NotCreated) VerifyStartOpts(opts *StartOpts) error

type Paused

type Paused struct {
	VMConfig *config.VMConfig
	Config   *config.Config

	UI        UI
	VBox      VBox
	SSHClient SSH
	FS        FS
}

func (*Paused) GetDebugLogs

func (p *Paused) GetDebugLogs() error

func (*Paused) Provision

func (p *Paused) Provision(opts *StartOpts) error

func (*Paused) Resume

func (p *Paused) Resume() error

func (*Paused) SSH

func (p *Paused) SSH() error

func (*Paused) Start

func (p *Paused) Start(opts *StartOpts) error

func (*Paused) Status

func (p *Paused) Status() string

func (*Paused) Stop

func (p *Paused) Stop() error

func (*Paused) Suspend

func (p *Paused) Suspend() error

func (*Paused) Target

func (p *Paused) Target(autoTarget bool) error

func (*Paused) Trust

func (p *Paused) Trust(startOps *StartOpts) error

func (*Paused) VerifyStartOpts

func (p *Paused) VerifyStartOpts(opts *StartOpts) error

type ProvisionVMError

type ProvisionVMError struct {
	Err error
}

func (*ProvisionVMError) Error

func (e *ProvisionVMError) Error() string

type ResumeVMError

type ResumeVMError struct {
	Err error
}

func (*ResumeVMError) Error

func (e *ResumeVMError) Error() string

type Running

type Running struct {
	Config   *config.Config
	VMConfig *config.VMConfig

	VBox       VBox
	FS         FS
	UI         UI
	SSHClient  SSH
	Builder    Builder
	LogFetcher LogFetcher
	CertStore  CertStore
	CmdRunner  CmdRunner
	HelpText   HelpText
}

func (*Running) GetDebugLogs

func (r *Running) GetDebugLogs() error

func (*Running) Provision

func (r *Running) Provision(opts *StartOpts) error

func (*Running) Resume

func (r *Running) Resume() error

func (*Running) SSH

func (r *Running) SSH() error

func (*Running) Start

func (r *Running) Start(opts *StartOpts) error

func (*Running) Status

func (r *Running) Status() string

func (*Running) Stop

func (r *Running) Stop() error

func (*Running) Suspend

func (r *Running) Suspend() error

func (*Running) Target

func (r *Running) Target(autoTarget bool) error

func (*Running) Trust

func (r *Running) Trust(startOpts *StartOpts) error

func (*Running) VerifyStartOpts

func (r *Running) VerifyStartOpts(opts *StartOpts) error

type SSH

type SSH interface {
	GenerateAddress() (host string, port string, err error)
	StartSSHSession(addresses []ssh.SSHAddress, privateKey []byte, timeout time.Duration, stdin io.Reader, stdout io.Writer, stderr io.Writer) error
	WaitForSSH(addresses []ssh.SSHAddress, privateKey []byte, timeout time.Duration) error
	RunSSHCommand(command string, addresses []ssh.SSHAddress, privateKey []byte, timeout time.Duration, stdout io.Writer, stderr io.Writer) error
	GetSSHOutput(command string, addresses []ssh.SSHAddress, privateKey []byte, timeout time.Duration) (combinedOutput string, err error)
}

type Saved

type Saved struct {
	VMConfig *config.VMConfig
	Config   *config.Config

	FS        FS
	UI        UI
	VBox      VBox
	SSHClient SSH
}

func (*Saved) GetDebugLogs

func (s *Saved) GetDebugLogs() error

func (*Saved) Provision

func (s *Saved) Provision(opts *StartOpts) error

func (*Saved) Resume

func (s *Saved) Resume() error

func (*Saved) SSH

func (s *Saved) SSH() error

func (*Saved) Start

func (s *Saved) Start(opts *StartOpts) error

func (*Saved) Status

func (s *Saved) Status() string

func (*Saved) Stop

func (s *Saved) Stop() error

func (*Saved) Suspend

func (s *Saved) Suspend() error

func (*Saved) Target

func (s *Saved) Target(autoTarget bool) error

func (*Saved) Trust

func (s *Saved) Trust(startOps *StartOpts) error

func (*Saved) VerifyStartOpts

func (s *Saved) VerifyStartOpts(opts *StartOpts) error

type StartOpts

type StartOpts struct {
	CPUs           int
	Memory         uint64
	NoProvision    bool
	OVAPath        string
	Registries     string
	Services       string
	Trust          bool
	PrintCA        bool
	Target         bool
	IP             string
	Domain         string
	MasterPassword string
}

type StartVMError

type StartVMError struct {
	Err error
}

func (*StartVMError) Error

func (e *StartVMError) Error() string

type StopVMError

type StopVMError struct {
	Err error
}

func (*StopVMError) Error

func (e *StopVMError) Error() string

type Stopped

type Stopped struct {
	Config   *config.Config
	VMConfig *config.VMConfig

	FS        FS
	VBox      VBox
	SSHClient SSH
	UI        UI
	Builder   Builder
}

func (*Stopped) GetDebugLogs

func (s *Stopped) GetDebugLogs() error

func (*Stopped) Provision

func (s *Stopped) Provision(opts *StartOpts) error

func (*Stopped) Resume

func (s *Stopped) Resume() error

func (*Stopped) SSH

func (s *Stopped) SSH() error

func (*Stopped) Start

func (s *Stopped) Start(opts *StartOpts) error

func (*Stopped) Status

func (s *Stopped) Status() string

func (*Stopped) Stop

func (s *Stopped) Stop() error

func (*Stopped) Suspend

func (s *Stopped) Suspend() error

func (*Stopped) Target

func (s *Stopped) Target(autoTarget bool) error

func (*Stopped) Trust

func (s *Stopped) Trust(startOps *StartOpts) error

func (*Stopped) VerifyStartOpts

func (s *Stopped) VerifyStartOpts(opts *StartOpts) error

type SuspendVMError

type SuspendVMError struct {
	Err error
}

func (*SuspendVMError) Error

func (e *SuspendVMError) Error() string

type TargetError

type TargetError struct {
	Err error
}

func (*TargetError) Error

func (e *TargetError) Error() string

type TrustError

type TrustError struct {
	Err error
}

func (*TrustError) Error

func (e *TrustError) Error() string

type UI

type UI interface {
	Failed(message string, args ...interface{})
	Say(message string, args ...interface{})
	Confirm(message string) bool
	Ask(prompt string) (answer string)
}

type Unprovisioned

type Unprovisioned struct {
	FS         FS
	SSHClient  SSH
	UI         UI
	VBox       VBox
	LogFetcher LogFetcher
	Config     *config.Config
	VMConfig   *config.VMConfig
	HelpText   HelpText
	Client     Client
}

func (*Unprovisioned) GetDebugLogs

func (u *Unprovisioned) GetDebugLogs() error

func (*Unprovisioned) Provision

func (u *Unprovisioned) Provision(opts *StartOpts) error

func (*Unprovisioned) Resume

func (u *Unprovisioned) Resume() error

func (*Unprovisioned) SSH

func (u *Unprovisioned) SSH() error

func (*Unprovisioned) Start

func (u *Unprovisioned) Start(opts *StartOpts) error

func (*Unprovisioned) Status

func (u *Unprovisioned) Status() string

func (*Unprovisioned) Stop

func (u *Unprovisioned) Stop() error

func (*Unprovisioned) Suspend

func (u *Unprovisioned) Suspend() error

func (*Unprovisioned) Target

func (u *Unprovisioned) Target(autoTarget bool) error

func (*Unprovisioned) Trust

func (u *Unprovisioned) Trust(startOps *StartOpts) error

func (*Unprovisioned) VerifyStartOpts

func (u *Unprovisioned) VerifyStartOpts(opts *StartOpts) error

type VBox

type VBox interface {
	StartVM(vmConfig *config.VMConfig) error
	StopVM(vmConfig *config.VMConfig) error
	ResumeSavedVM(vmConfig *config.VMConfig) error
	ResumePausedVM(vmConfig *config.VMConfig) error
	SuspendVM(vmConfig *config.VMConfig) error
	PowerOffVM(vmConfig *config.VMConfig) error
	ImportVM(vmConfig *config.VMConfig) error
	VMStatus(vmName string) (state string, err error)
	VMConfig(vmName string) (vmConfig *config.VMConfig, err error)
}

type VBoxBuilder

type VBoxBuilder struct {
	Config *config.Config
	VBox   VBox
	FS     FS
	SSH    SSH
	Client Client
	UI     UI
}

func (*VBoxBuilder) VM

func (b *VBoxBuilder) VM(vmName string) (VM, error)

type VM

type VM interface {
	Start(*StartOpts) error
	Provision(*StartOpts) error
	Stop() error
	Status() string
	Suspend() error
	Resume() error
	GetDebugLogs() error
	Trust(*StartOpts) error
	Target(autoTarget bool) error
	SSH() error

	VerifyStartOpts(*StartOpts) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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