vms

package
v1.6.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: BSD-3-Clause Imports: 8 Imported by: 66

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory added in v1.4.8

type Factory interface {
	New(*snow.Context) (interface{}, error)
}

A Factory creates new instances of a VM

type Manager

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

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

	// Versions returns the versions of all the VMs that have been registered
	Versions() (map[string]string, 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 *server.Server, log logging.Logger) Manager

NewManager returns an instance of a VM manager

Jump to

Keyboard shortcuts

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