summaryrefslogtreecommitdiff
path: root/bar.go
diff options
context:
space:
mode:
Diffstat (limited to 'bar.go')
-rw-r--r--bar.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/bar.go b/bar.go
new file mode 100644
index 0000000..5974ff4
--- /dev/null
+++ b/bar.go
@@ -0,0 +1,21 @@
+package main
+
+import "time"
+
+// Bar is the struct that holds each of the modules and displays the data from them
+type Bar struct {
+ Modules []Module
+ RefreshRate time.Duration
+}
+
+func (b Bar) Display() string {
+ var val string
+
+ for _, mod := range b.Modules {
+ s, _ := mod.GetInfo()
+ val += s
+ time.Sleep(b.RefreshRate)
+ }
+
+ return val
+}