diff options
| author | Jeff Carr <[email protected]> | 2024-10-22 17:27:24 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-22 17:27:24 -0500 |
| commit | 673bcc6cc9e4504ff707d6cef7575eb1ce152e7c (patch) | |
| tree | c4f56d6a146a94c3df163f0a8208409e66a83f56 /structs.go | |
| parent | 3b64d342d290d1bea1a8f6edee11fa35997a79c5 (diff) | |
start migration to protobufs
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'structs.go')
| -rw-r--r-- | structs.go | 37 |
1 files changed, 21 insertions, 16 deletions
@@ -1,6 +1,10 @@ package main -import "time" +import ( + "time" + + pb "go.wit.com/lib/protobuf/virtbuf" +) var me virtigoT @@ -16,6 +20,7 @@ func (b *virtigoT) Enable() { // this app's variables type virtigoT struct { + cluster *pb.Cluster names []string hypers []*HyperT droplets []*DropletT @@ -25,24 +30,24 @@ type virtigoT struct { // the stuff that is needed for a hypervisor type HyperT struct { - Hostname string // the hypervisor hostname - Active bool // is allowed to start new droplets - 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 + pb *pb.Hypervisor // the Hypervisor protobuf + Active bool // is allowed to start new droplets + 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 killcount int } // 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) - ConfigState string // what the state of the droplet is SUPPOSED TO BE - CurrentState string // what the state of the droplet is ACTUALLY IS - hyperPreferred string // the hypervisor to prefer to run the droplet on - 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 - starts int // how many times a start event has been attempted + pb *pb.Droplet // the Droplet protobuf + ConfigState string // what the state of the droplet is SUPPOSED TO BE + CurrentState string // what the state of the droplet is ACTUALLY IS + hyperPreferred string // the hypervisor to prefer to run the droplet on + 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 + starts int // how many times a start event has been attempted } |
