summaryrefslogtreecommitdiff
path: root/structs.go
blob: 02d1b7f9bf2f2432d3d40b0dd21ad92c7092c54a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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
	hypers   []*HyperT
	droplets []*DropletT
}

// 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
	lastpoll     time.Time // the last time the hypervisor polled
}

// the stuff that is needed for a hypervisor
type DropletT struct {
	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
}