From ade54fdedac3bf89636f914b89fd17eaa972947f Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 26 Oct 2024 06:01:19 -0500 Subject: events should not be plural Signed-off-by: Jeff Carr --- helpers.go | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'helpers.go') diff --git a/helpers.go b/helpers.go index e9864ae..d55f64a 100644 --- a/helpers.go +++ b/helpers.go @@ -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 { -- cgit v1.2.3