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:
@@ -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.")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user