You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
775 B

package main
import (
"encoding/json"
"io/ioutil"
)
//MatrixConfig stores the matrix data config
type MatrixConfig struct {
RoomId string `json:"room_id"`
User string `json:"user"`
Password string `json:"password"`
Server string `json:"server"`
}
type Service struct {
Name string `json:"name"`
Url string `json:"url"`
StatusCode int `json:"statusCode"`
Counter int
}
type Config struct {
Matrix MatrixConfig `json:"matrix"`
Services []Service `json:"services"`
SleepTime int `json:"sleepTime"`
Retry int `json:"retry"`
}
var config Config
func readConfig() {
file, e := ioutil.ReadFile("config.json")
if e != nil {
panic(e)
}
content := string(file)
json.Unmarshal([]byte(content), &config)
}