backend

package
v0.0.0-...-6dbc452 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var STATES = map[libvirt.ConnectListAllDomainsFlags]string{libvirt.ConnectListDomainsRunning: "Running", libvirt.ConnectListDomainsPaused: "Paused", libvirt.ConnectListDomainsShutoff: "Shutoff"}

Functions

func Connect

func Connect() (*libvirt.Libvirt, error)

func WriteConfig

func WriteConfig(config Config) error

Types

type App

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

App struct

func NewApp

func NewApp() *App

NewApp creates a new App application struct

func (*App) CheckIfIsInstalled

func (a *App) CheckIfIsInstalled() bool

func (*App) GenerateConfig

func (a *App) GenerateConfig(provider string) (Config, error)

func (*App) GetAllVmsStats

func (a *App) GetAllVmsStats() []Vm

func (*App) Startup

func (a *App) Startup(ctx context.Context)

startup is called when the app starts. The context is saved so we can call the runtime methods

func (*App) TestConnection

func (a *App) TestConnection(socketPath string) (bool, error)

type Config

type Config struct {
	Provider string
	Vms      []Vm
}

type Provider

type Provider struct {
	Name string
}

type Vm

type Vm struct {
	Name     string
	Os       string
	Memory   int32
	CpuUsage uint64
}

Jump to

Keyboard shortcuts

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