virtigo/structs.go

49 lines
2.0 KiB
Go
Raw Normal View History

package main
import (
"time"
"go.wit.com/gui"
2025-02-22 17:45:50 -06:00
"go.wit.com/lib/protobuf/virtpb"
)
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 {
2025-02-22 17:45:50 -06:00
cluster *virtpb.Cluster // basic cluster settings
myGui *gui.Node // the gui toolkit handle
e *virtpb.Events // virt protobuf events
hmap map[*virtpb.Hypervisor]*HyperT // map to the local struct
names []string // ?
hypers []*HyperT // notsure
killcount int // how many times virtigo-d has had to been killed
unstable time.Time // the last time the cluster was incorrect
changed bool // have things changed?
hyperPollDelay time.Duration // how often to poll the hypervisors
unstableTimeout time.Duration // how long a droplet can be unstable until it's declared dead
clusterStableDuration time.Duration // how long the cluster must be stable before new droplets can be started
missingDropletTimeout time.Duration // how long a droplet can be missing for
2025-02-23 17:01:22 -06:00
status *gui.Node // the cluster status
lastuptime *gui.Node // the last time uptime was checked by Kuma
}
// the stuff that is needed for a hypervisor
type HyperT struct {
2025-02-22 17:45:50 -06:00
pb *virtpb.Hypervisor // the Hypervisor protobuf
dog *time.Ticker // the watchdog timer itself
lastpoll time.Time // the last time the hypervisor polled
lastDroplets map[string]time.Time // the vm's in the last poll
killcount int // how many times the daemon has been forcably killed
}