2024-10-12 10:59:11 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
var me virtigoT
|
|
|
|
|
|
|
|
// disable the GUI
|
|
|
|
func (b *virtigoT) Disable() {
|
|
|
|
// b.mainbox.Disable()
|
|
|
|
}
|
|
|
|
|
|
|
|
// enable the GUI
|
|
|
|
func (b *virtigoT) Enable() {
|
|
|
|
// b.mainbox.Enable()
|
|
|
|
}
|
|
|
|
|
|
|
|
// this app's variables
|
|
|
|
type virtigoT struct {
|
|
|
|
names []string
|
2024-10-13 00:40:22 -05:00
|
|
|
hypers []*HyperT
|
2024-10-12 11:54:01 -05:00
|
|
|
droplets []*DropletT
|
2024-10-12 10:59:11 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// the stuff that is needed for a hypervisor
|
|
|
|
type HyperT struct {
|
|
|
|
Hostname string // the hypervisor hostname
|
|
|
|
Scan func() // the function to run to scan the hypervisor
|
|
|
|
Autoscan bool // to scan or not to scan
|
|
|
|
Delay time.Duration // how often to poll the hypervisor
|
|
|
|
Dog *time.Ticker // the watchdog timer itself
|
2024-10-13 00:40:22 -05:00
|
|
|
lastpoll time.Time // the last time the hypervisor polled
|
2024-10-12 10:59:11 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// the stuff that is needed for a hypervisor
|
|
|
|
type DropletT struct {
|
2024-10-12 12:45:43 -05:00
|
|
|
Hostname string // the name of the virtual machine. should be unique (probably enforce this forever)
|
|
|
|
State string // what the state of the droplet is SUPPOSED TO BE
|
|
|
|
CurrentState string // what the state of the droplet is ACTUALLY IS
|
|
|
|
hname string // the hypervisor it's currently running on
|
|
|
|
h *HyperT // the hypervisor it's currently running on
|
|
|
|
lastpoll time.Time // the last time the droplet was seen running
|
2024-10-12 10:59:11 -05:00
|
|
|
}
|