diff options
Diffstat (limited to 'helpers.go')
| -rw-r--r-- | helpers.go | 32 |
1 files changed, 7 insertions, 25 deletions
@@ -25,32 +25,14 @@ func (x *Hypervisor) GetMemoryPrintable() string { return fmt.Sprintf("%d GB", i) } -/* -func (c *Cluster) MarshalJSON() ([]byte, error) { - return protojson.Marshal(c) -} - -func (c *Cluster) FormatJSON() string { - return protojson.Format(c) -} - -func (c *Cluster) UnmarshalJSON(data []byte) error { - return protojson.Unmarshal(data, c) -} -*/ - -// apparently this isn't supposed to be used? -// https://protobuf.dev/reference/go/faq/#unstable-text -// this is a shame because this is much nicer output than JSON Format() -/* -func (c *Cluster) FormatTEXT() string { - return prototext.Format(c) -} - -func (d *Droplets) FormatTEXT() string { - return prototext.Format(d) +func (all *Droplets) FindDroplet(name string) *Droplet { + for _, d := range all.Droplets { + if d.Hostname == name { + return d + } + } + return nil } -*/ func (c *Cluster) FindDroplet(name string) *Droplet { for _, d := range c.Droplets { |
