diff options
| author | Jeff Carr <[email protected]> | 2024-10-30 02:28:53 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-30 02:28:53 -0500 |
| commit | 73b81913fa941504dfd2aa84fab9692b34fdcff6 (patch) | |
| tree | e63dcac97b103498428e0698f75f05eb9425f451 /structs.go | |
initial commitv0.0.1
Diffstat (limited to 'structs.go')
| -rw-r--r-- | structs.go | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/structs.go b/structs.go new file mode 100644 index 0000000..715231a --- /dev/null +++ b/structs.go @@ -0,0 +1,43 @@ +package main + +import ( + "time" + + pb "go.wit.com/lib/protobuf/virtbuf" +) + +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 { + cluster *pb.Cluster // basic cluster settings + hmap map[*pb.Hypervisor]*HyperT // map to the local struct + names []string + hypers []*HyperT + killcount int + unstable time.Time // the last time the cluster was incorrect + changed bool + 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 +} + +// the stuff that is needed for a hypervisor +type HyperT struct { + pb *pb.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 +} |
