blob: a419f20462bb0ef15051097d6d5519a603e5d8be (
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
43
  | 
package main
import (
	"time"
	"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 {
	cluster   *virtpb.OldCluster                // basic cluster settings
	hmap      map[*virtpb.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           *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
}
  |