1
0
mirror of https://github.com/mgerb/ServerStatus synced 2026-01-10 03:03:04 +00:00

add polling interval to configurations - resolves #15

This commit is contained in:
2018-07-18 20:20:44 -05:00
parent 1cd9f139c2
commit bcb57c72a3
4 changed files with 21 additions and 6 deletions

View File

@@ -6,17 +6,19 @@ import (
"io/ioutil"
"log"
"os"
"time"
)
// Variables used for command line parameters
var Config configStruct
type configStruct struct {
Token string `json:"Token"`
RoomIDList []string `json:"RoomIDList"`
RolesToNotify []string `json:"RolesToNotify"`
Servers []server `json:"Servers"`
GameStatus string `json:"GameStatus"`
Token string `json:"Token"`
RoomIDList []string `json:"RoomIDList"`
RolesToNotify []string `json:"RolesToNotify"`
Servers []server `json:"Servers"`
GameStatus string `json:"GameStatus"`
PollingInterval time.Duration `json:"PollingInterval"`
}
type server struct {
@@ -43,4 +45,8 @@ func Configure() {
log.Println(err)
}
if Config.PollingInterval == 0 {
log.Fatal("Please set your PollingInterval > 0 in your config file.")
}
}