vms

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: BSD-3-Clause Imports: 7 Imported by: 1

Documentation

Overview

Package vms is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type Factory

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

A Factory creates new instances of a VM

type Manager

type Manager interface {
	ids.Aliaser

	// Return a factory that can create new instances of the vm whose ID is
	// [vmID]
	GetFactory(vmID ids.ID) (Factory, error)

	// Map [vmID] to [factory]. [factory] creates new instances of the vm whose
	// ID is [vmID]
	RegisterFactory(vmID ids.ID, factory Factory) error

	// ListVMs returns all the IDs that have had factories registered.
	ListVMs() ([]ids.ID, error)

	// Versions returns the primary alias of the VM mapped to the reported
	// version of the VM for all the registered VMs that reported versions.
	Versions() (map[string]string, error)
}

Manager tracks a collection of VM factories, their aliases, and their versions. 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. Manage the aliases of VMs
  4. Manage the versions of VMs

func NewManager

func NewManager() Manager

NewManager returns an instance of a VM manager

type MockFactory

type MockFactory struct {
	// contains filtered or unexported fields
}

MockFactory is a mock of Factory interface.

func NewMockFactory

func NewMockFactory(ctrl *gomock.Controller) *MockFactory

NewMockFactory creates a new mock instance.

func (*MockFactory) EXPECT

func (m *MockFactory) EXPECT() *MockFactoryMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockFactory) New

func (m *MockFactory) New(arg0 *snow.Context) (interface{}, error)

New mocks base method.

type MockFactoryMockRecorder

type MockFactoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockFactoryMockRecorder is the mock recorder for MockFactory.

func (*MockFactoryMockRecorder) New

func (mr *MockFactoryMockRecorder) New(arg0 interface{}) *gomock.Call

New indicates an expected call of New.

type MockManager

type MockManager struct {
	// contains filtered or unexported fields
}

MockManager is a mock of Manager interface.

func NewMockManager

func NewMockManager(ctrl *gomock.Controller) *MockManager

NewMockManager creates a new mock instance.

func (*MockManager) Alias

func (m *MockManager) Alias(id ids.ID, alias string) error

Alias mocks base method.

func (*MockManager) Aliases

func (m *MockManager) Aliases(id ids.ID) ([]string, error)

Aliases mocks base method.

func (*MockManager) EXPECT

func (m *MockManager) EXPECT() *MockManagerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockManager) GetFactory

func (m *MockManager) GetFactory(vmID ids.ID) (Factory, error)

GetFactory mocks base method.

func (*MockManager) ListVMs

func (m *MockManager) ListVMs() ([]ids.ID, error)

ListVMs mocks base method.

func (*MockManager) Lookup

func (m *MockManager) Lookup(alias string) (ids.ID, error)

Lookup mocks base method.

func (*MockManager) PrimaryAlias

func (m *MockManager) PrimaryAlias(id ids.ID) (string, error)

PrimaryAlias mocks base method.

func (*MockManager) PrimaryAliasOrDefault

func (m *MockManager) PrimaryAliasOrDefault(id ids.ID) string

PrimaryAliasOrDefault mocks base method.

func (*MockManager) RegisterFactory

func (m *MockManager) RegisterFactory(vmID ids.ID, factory Factory) error

RegisterFactory mocks base method.

func (*MockManager) RemoveAliases

func (m *MockManager) RemoveAliases(id ids.ID)

RemoveAliases mocks base method.

func (*MockManager) Versions

func (m *MockManager) Versions() (map[string]string, error)

Versions mocks base method.

type MockManagerMockRecorder

type MockManagerMockRecorder struct {
	// contains filtered or unexported fields
}

MockManagerMockRecorder is the mock recorder for MockManager.

func (*MockManagerMockRecorder) Alias

func (mr *MockManagerMockRecorder) Alias(id, alias interface{}) *gomock.Call

Alias indicates an expected call of Alias.

func (*MockManagerMockRecorder) Aliases

func (mr *MockManagerMockRecorder) Aliases(id interface{}) *gomock.Call

Aliases indicates an expected call of Aliases.

func (*MockManagerMockRecorder) GetFactory

func (mr *MockManagerMockRecorder) GetFactory(vmID interface{}) *gomock.Call

GetFactory indicates an expected call of GetFactory.

func (*MockManagerMockRecorder) ListVMs

func (mr *MockManagerMockRecorder) ListVMs() *gomock.Call

ListVMs indicates an expected call of ListVMs.

func (*MockManagerMockRecorder) Lookup

func (mr *MockManagerMockRecorder) Lookup(alias interface{}) *gomock.Call

Lookup indicates an expected call of Lookup.

func (*MockManagerMockRecorder) PrimaryAlias

func (mr *MockManagerMockRecorder) PrimaryAlias(id interface{}) *gomock.Call

PrimaryAlias indicates an expected call of PrimaryAlias.

func (*MockManagerMockRecorder) PrimaryAliasOrDefault

func (mr *MockManagerMockRecorder) PrimaryAliasOrDefault(id interface{}) *gomock.Call

PrimaryAliasOrDefault indicates an expected call of PrimaryAliasOrDefault.

func (*MockManagerMockRecorder) RegisterFactory

func (mr *MockManagerMockRecorder) RegisterFactory(vmID, factory interface{}) *gomock.Call

RegisterFactory indicates an expected call of RegisterFactory.

func (*MockManagerMockRecorder) RemoveAliases

func (mr *MockManagerMockRecorder) RemoveAliases(id interface{}) *gomock.Call

RemoveAliases indicates an expected call of RemoveAliases.

func (*MockManagerMockRecorder) Versions

func (mr *MockManagerMockRecorder) Versions() *gomock.Call

Versions indicates an expected call of Versions.

Directories

Path Synopsis
components
Package platformvm is a generated GoMock package.
Package platformvm is a generated GoMock package.
Package registry is a generated GoMock package.
Package registry is a generated GoMock package.
Package rpcchainvm is a generated GoMock package.
Package rpcchainvm is a generated GoMock package.

Jump to

Keyboard shortcuts

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