summaryrefslogtreecommitdiff
path: root/helpers.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-26 06:01:19 -0500
committerJeff Carr <[email protected]>2024-10-26 06:01:19 -0500
commitade54fdedac3bf89636f914b89fd17eaa972947f (patch)
treec1f00a440a436a3b0738b865d89a1a8c5e3a81f7 /helpers.go
parenta8484013dc62bc0750f780b04b46cd48fe85ee5b (diff)
events should not be plural
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'helpers.go')
-rw-r--r--helpers.go32
1 files changed, 7 insertions, 25 deletions
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 {