example runs

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-31 13:12:11 -05:00
parent 10793e365d
commit e8834578fb
3 changed files with 11 additions and 2 deletions

View File

@ -22,7 +22,7 @@ func main() {
} }
var c *pb.NewCluster var c *pb.NewCluster
c = new(pb.NewCluster) c = pb.InitCluster()
// log.Println(aCluster.String()) // log.Println(aCluster.String())
// show the droplets to STDOUT // show the droplets to STDOUT

View File

@ -9,6 +9,15 @@ import (
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
func InitCluster() *NewCluster {
var c *NewCluster
c = new(NewCluster)
c.d = new(Droplets)
c.h = new(Hypervisors)
c.e = new(Events)
return c
}
// human readable JSON // human readable JSON
func (d *Droplets) FormatJSON() string { func (d *Droplets) FormatJSON() string {
return protojson.Format(d) return protojson.Format(d)

View File

@ -71,7 +71,7 @@ func (c *NewCluster) SelectDropletAll() []*Droplet {
var dropletPointers []*Droplet var dropletPointers []*Droplet
if c.d == nil { if c.d == nil {
log.Info("SelectDropletsAll() c.d == nil") log.Info("SelectDropletsAll() c.d == nil")
os.Exit(-1) // os.Exit(-1)
} }
for _, d := range c.d.Droplets { for _, d := range c.d.Droplets {
if d == nil { if d == nil {