Merge
This commit is contained in:
parent
4adf19a16b
commit
621d57c9e0
2 changed files with 5 additions and 3 deletions
|
@ -45,5 +45,5 @@ func LoadConfig() Config {
|
|||
type ServiceStatus struct {
|
||||
Name string
|
||||
Ok bool
|
||||
// Status string
|
||||
Status string
|
||||
}
|
||||
|
|
|
@ -4,19 +4,20 @@ import "log"
|
|||
|
||||
func TestService(service ServiceConfig) ServiceStatus {
|
||||
var serviceResult bool
|
||||
var status string
|
||||
|
||||
url := service.URL()
|
||||
switch url.Scheme {
|
||||
case "http", "https":
|
||||
{
|
||||
serviceResult = Request(url.String())
|
||||
serviceResult, status = Request(url.String())
|
||||
break
|
||||
}
|
||||
|
||||
case "tcp":
|
||||
{
|
||||
// go includes port in host
|
||||
serviceResult = CheckTCPOpen(url.Host)
|
||||
serviceResult, status = CheckTCPOpen(url.Host)
|
||||
break
|
||||
}
|
||||
default:
|
||||
|
@ -27,5 +28,6 @@ func TestService(service ServiceConfig) ServiceStatus {
|
|||
return ServiceStatus{
|
||||
Name: service.description,
|
||||
Ok: serviceResult,
|
||||
Status: status,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue