misc

package module
v0.0.0-...-ac2c500 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NonExistErr

type NonExistErr string

NonExistErr VM, funcClient, etc does not exist.

func (NonExistErr) Error

func (e NonExistErr) Error() string

type VM

type VM struct {
	ID        string
	Image     *containerd.Image
	Container *containerd.Container
	Task      *containerd.Task
	TaskCh    <-chan containerd.ExitStatus
	Ni        *taps.NetworkInterface
}

VM type

func NewVM

func NewVM(vmID string) *VM

NewVM Initialize a VM

type VMPool

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

VMPool Pool of active VMs (can be in several states though)

func NewVMPool

func NewVMPool() *VMPool

NewVMPool Initializes a pool of VMs

func (*VMPool) Allocate

func (p *VMPool) Allocate(vmID string) (*VM, error)

Allocate Initializes a VM, activates it and then adds it to VM map

func (*VMPool) Free

func (p *VMPool) Free(vmID string) error

Free Removes a VM from the pool and transitions it to Deactivating

func (*VMPool) GetVM

func (p *VMPool) GetVM(vmID string) (*VM, error)

GetVM Returns a pointer to the VM

func (*VMPool) GetVMMap

func (p *VMPool) GetVMMap() map[string]*VM

GetVMMap Returns a copy of vmMap as a regular concurrency-unsafe map

func (*VMPool) RecreateTap

func (p *VMPool) RecreateTap(vmID string) error

RecreateTap Deletes and creates the tap for a VM

func (*VMPool) RemoveBridges

func (p *VMPool) RemoveBridges()

RemoveBridges Removes the bridges created by the tap manager

Jump to

Keyboard shortcuts

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