mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Configuration used throughout the app
This commit is contained in:
committed by
Chris Cummer
parent
45d88c6700
commit
c3f1d7ee36
@@ -10,27 +10,22 @@ import (
|
||||
"github.com/senorprogrammer/wtf/wtf"
|
||||
)
|
||||
|
||||
var Config *config.Config
|
||||
|
||||
type Widget struct {
|
||||
wtf.BaseWidget
|
||||
|
||||
Config *config.Config
|
||||
Current int
|
||||
View *tview.TextView
|
||||
}
|
||||
|
||||
func NewWidget(config *config.Config) *Widget {
|
||||
refreshInterval, err := config.Int("wtf.status.refreshInterval")
|
||||
if err != nil {
|
||||
refreshInterval = 1
|
||||
}
|
||||
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{
|
||||
BaseWidget: wtf.BaseWidget{
|
||||
Name: "Status",
|
||||
RefreshedAt: time.Now(),
|
||||
RefreshInt: refreshInterval,
|
||||
RefreshInt: Config.UInt("wtf.status.refreshInterval", 1),
|
||||
},
|
||||
Config: config,
|
||||
Current: 0,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user