impl config State and config Interval

This commit is contained in:
Bel LaPointe
2022-01-09 21:23:27 -05:00
parent 18215b42c0
commit bf3c382877
6 changed files with 101 additions and 4 deletions

15
main.go
View File

@@ -2,7 +2,9 @@ package main
import (
"errors"
"fmt"
"local/truckstop/config"
"time"
)
func main() {
@@ -15,5 +17,16 @@ func _main() error {
if err := config.Refresh(); err != nil {
return err
}
return errors.New("not impl")
for {
if err := once(); err != nil {
return err
}
time.Sleep(config.Get().Interval.Get())
}
return nil
}
func once() error {
states := config.Get().States
return errors.New("not impl" + fmt.Sprint(states))
}