parent
10793e365d
commit
e8834578fb
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue