provider

package
v0.0.0-...-3fa228a Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2016 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRegion

func DefaultRegion(m db.Machine) db.Machine

DefaultRegion populates `m.Region` for the provided db.Machine if one isn't specified. This is intended to allow users to omit the cloud provider region when they don't particularly care where a system is placed.

func GroupBy

func GroupBy(machines []Machine) map[db.Provider][]Machine

GroupBy transforms the `machines` into a map of `db.Provider` to the machines with that provider.

Types

type Machine

type Machine struct {
	ID        string
	PublicIP  string
	PrivateIP string
	Size      string
	DiskSize  int
	SSHKeys   []string
	Provider  db.Provider
	Region    string
}

Machine represents an instance of a machine booted by a Provider.

type Provider

type Provider interface {
	Connect(namespace string) error

	List() ([]Machine, error)

	Boot([]Machine) error

	Stop([]Machine) error

	SetACLs(acls []string) error

	ChooseSize(ram stitch.Range, cpu stitch.Range, maxPrice float64) string
}

Provider defines an interface for interacting with cloud providers.

func New

func New(dbp db.Provider) Provider

New returns an empty instance of the Provider represented by `dbp`

Jump to

Keyboard shortcuts

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