summaryrefslogtreecommitdiff
path: root/lgc/lgc.go
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2023-04-25 22:53:35 -0400
committerWill Hawkins <[email protected]>2023-04-25 23:00:12 -0400
commitc9a33075c873c4ef8bb3c695cce721172c31d361 (patch)
treee46e766182bba75f0bcc707bf72b4359ce8ecd9f /lgc/lgc.go
parent9e9963f7767719e4c26e2345169d7768ec5151ac (diff)
Make LgcStatus String()-able
Make an LgcStatus type print nicely with %v format verb.
Diffstat (limited to 'lgc/lgc.go')
-rw-r--r--lgc/lgc.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/lgc/lgc.go b/lgc/lgc.go
index b16eb76..db73efa 100644
--- a/lgc/lgc.go
+++ b/lgc/lgc.go
@@ -41,3 +41,17 @@ const (
LGC_STATUS_DONE
LGC_STATUS_ERROR
)
+
+func (status LgcStatus) String() string {
+ switch status {
+ case LGC_STATUS_DONE:
+ return "Load-Generating Connection Done"
+ case LGC_STATUS_RUNNING:
+ return "Load-Generating Connection Running"
+ case LGC_STATUS_ERROR:
+ return "Load-Generating Connection Error"
+ case LGC_STATUS_NOT_STARTED:
+ return "Load-Generating Connection Not Started"
+ }
+ return "Load-Generating Connection in invalid state"
+}