Documentation
¶
Index ¶
- Variables
- func CheckDataDir()
- func CheckGET(s Service, url string) (bool, int)
- func CheckHTTP(s Service) (bool, int)
- func CheckHTTPS(s Service) (bool, int)
- func CheckRemoved()
- func CheckService(s Service) (bool, int)
- func CheckTCP(s Service, useTls bool) (bool, int)
- func GetInterval() time.Duration
- func LoadData()
- func Loop()
- func SaveData()
- func SaveResult(service Service, t int, ok bool)
- type Config
- type Data
- type Result
- type Rule
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var Checkchan = make(chan struct{})
View Source
var LastChecked time.Time
View Source
var Services []Service
Functions ¶
func CheckDataDir ¶
func CheckDataDir()
func CheckHTTPS ¶
func CheckRemoved ¶
func CheckRemoved()
func CheckService ¶
func GetInterval ¶
func SaveResult ¶
Types ¶
type Config ¶
type Data ¶
type Data struct {
Services []Service `json:"services"`
}
data is just a json list containing all the services as well as check results
type Service ¶
type Service struct {
// results are not set in the config,
// they are loaded/dumped to the data file
Results []Result `json:"results"`
// these are also not set in the config
// just stores the last connection time
// and the success status for quick access
LastTime int `json:"last_time"`
LastSuccess bool `json:"last_success"`
Name string `json:"name"`
Address string `json:"address"`
Type string `json:"type"`
Data string `json:"data"`
Link string `json:"link"`
Rule Rule `json:"rule"`
}
func GetServices ¶
func GetServices() []Service
Click to show internal directories.
Click to hide internal directories.