diff options
author | Jackson Taylor <jtaylormuffins@gmail.com> | 2020-04-08 17:47:08 -0400 |
---|---|---|
committer | Jackson Taylor <jtaylormuffins@gmail.com> | 2020-04-08 17:47:08 -0400 |
commit | 203575b1f97501fd190bea67c11552f0635faa8d (patch) | |
tree | 624fd409095cfff11b8e0c89abf60b5a2c76f0cc /bar.go | |
parent | 4667dba8a735291a85aa5a29543fa6e538390233 (diff) |
Make Bar its own file
Add bar.go
Add refresh rate to bar struct
Diffstat (limited to 'bar.go')
-rw-r--r-- | bar.go | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 +} |