summaryrefslogtreecommitdiff
path: root/bar.go
blob: 5974ff4cc2edd12fcb3314a658b00e8a67bd4015 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
}