types

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StateRunning = MachineState{"Running"}
View Source
var StateSleeping = MachineState{"Sleeping"}
View Source
var StateStarting = MachineState{"Starting"}
View Source
var StateStopped = MachineState{"Stopped"}
View Source
var StateStopping = MachineState{"Stopping"}
View Source
var StateTerminated = MachineState{"Terminated"}
View Source
var StateTerminating = MachineState{"Terminating"}
View Source
var StateUnknown = MachineState{"Unknown"}

Functions

This section is empty.

Types

type Environment

type Environment interface {
	Name() string
	VMs() []VM
	Profile() Profile
	StartVM(string) error
	StopVM(string) error
	RestartVM(string) error
	ImageBuilds() ([]ImageBuild, error)
	Images() ([]Image, error)
	CreateVM(MachineLaunchOptions) error
	DestroyVM(string) error
	DestroyImage(string) error
}

type Image added in v0.3.0

type Image interface {
	ID() string
	Name() string
	CreatedAt() string
	Environment() Environment
	Profile() Profile
	Provider() Provider
	Launch(imageLaunchOptions ImageLaunchOptions) error
	Destroy() error
}

type ImageBuild added in v0.3.0

type ImageBuild interface {
	Name() string
	ProviderType() string
	Provisioner() string
	Build() error
}

type ImageLaunchOptions added in v0.4.0

type ImageLaunchOptions struct {
	Name string
}

type MachineLaunchOptions added in v0.3.0

type MachineLaunchOptions struct {
	CloudInitTpl string `json:"cloud-init"`
	Image        Image  `json:"image"`
	Name         string `json:"name"`
}

type MachineState

type MachineState struct {
	Name string `json:"name"`
}

type Profile added in v0.3.0

type Profile interface {
	Environments() []Environment
	Name() string
	Provider() Provider
	SetConfig(config common.ProfileConfig)
	GetConfig() common.ProfileConfig
	ShouldIncludeEnvironment(envName string) bool
}

type Project added in v0.4.0

type Project interface {
	Name() string
	TerraformApply() error
	AddMachine(machine *ProjectMachine, noApply bool) error
}

type ProjectConfig added in v0.4.0

type ProjectConfig struct {
	Machines []*ProjectMachine `yaml:"machines"`
}

type ProjectMachine added in v0.4.0

type ProjectMachine struct {
	Name       string `yaml:"name"`
	Image      string `yaml:"image,omitempty"`
	Type       string `yaml:"type,omitempty"`
	Profile    string `yaml:"profile,omitempty"`
	Purpose    string `yaml:"purpose,omitempty"`
	VolumeSize int    `yaml:"volume_size,omitempty"`
	Provider   string `yaml:"provider,omitempty"`
}

type Provider

type Provider interface {
	Profiles() []Profile
	Name() string
	Type() string
	IsAvailable() bool
	SetConfig(config common.ProviderConfig)
	GetConfig() common.ProviderConfig
	NewImageBuild(name string, tplDir string) (ImageBuild, error)
	NewProject(name string, force bool) (Project, error)
}

type VM

type VM interface {
	Name() string
	ID() string
	IPAddress() string
	PrivateIPAddress() string
	UpTime() time.Duration
	State() string
	Type() string

	Environment() Environment
	Profile() Profile
	Provider() Provider

	Destroy() error
	Start() error
	Stop() error
	Restart() error

	ExecSSH(string, bool, ...string) error
	StartVNC(user string, privateIP bool, killVNC bool) error
	Cmd(string, bool, ...string) (string, error)
	NewSSHSession(string, bool) (*ssh_util.Session, error)
}

Jump to

Keyboard shortcuts

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