summaryrefslogtreecommitdiff
path: root/structs.go
blob: a19c2ba65c4421acf54e078a72b68091ed39bf49 (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
44
45
46
47
48
49
50
51
52
53
54
55
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
	delay   time.Duration // how often to poll the hypervisors
	// events    *pb.Events                // cluster events
	// dmap      map[*pb.Droplet]*DropletT // map to the local struct
	hmap   map[*pb.Hypervisor]*HyperT // map to the local struct
	names  []string
	hypers []*HyperT
	// droplets  []*DropletT
	killcount int
	unstable  time.Time // the last time the cluster was incorrect
	changed   bool
	// dirs      []string // all the paths too search for a qcow image
}

// 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
	killcount int
}

/*
// the stuff that is needed for a hypervisor
type DropletT struct {
	pb           *pb.Droplet        // the Droplet protobuf
	xml          *libvirtxml.Domain // a xml representation from libvirt
	h            *HyperT            // the hypervisor it's currently running on
	CurrentState pb.DropletState    // what the state of the droplet is ACTUALLY IS
	lastpoll     time.Time          // the last time the droplet was seen running
	starts       int                // how many times a start event has been attempted
}
*/