vms

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// Returns a factory that can create new instances of the VM
	// with the given ID
	GetVMFactory(ids.ID) (VMFactory, error)

	// Associate an ID with the factory that creates new instances
	// of the VM with the given ID
	RegisterVMFactory(ids.ID, VMFactory) error

	// Given an alias, return the ID of the VM associated with that alias
	Lookup(string) (ids.ID, error)

	// Return the aliases associated with a VM
	Aliases(ids.ID) []string

	// Give an alias to a VM
	Alias(ids.ID, string) error
}

Manager is a VM manager. It has the following functionality:

  1. Register a VM factory. To register a VM is to associate its ID with a VMFactory which, when New() is called upon it, creates a new instance of that VM.
  2. Get a VM factory. Given the ID of a VM that has been registered, return the factory that the ID is associated with.
  3. Associate a VM with an alias
  4. Get the ID of the VM by the VM's alias
  5. Get the aliases of a VM

func NewManager

func NewManager(apiServer *api.Server, log logging.Logger) Manager

NewManager returns an instance of a VM manager

type VMFactory

type VMFactory interface {
	New() (interface{}, error)
}

A VMFactory creates new instances of a VM

Jump to

Keyboard shortcuts

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