minor cleanup

This commit is contained in:
Locria Cyber 2023-10-04 09:58:14 +00:00
parent 47a646e78b
commit ed440f582f
Signed by: iacore
GPG key ID: F8C16E5157A63006

View file

@ -37,26 +37,15 @@ func CheckService(service ServiceConfig, ctx context.Context) ServiceStatus {
url := service.URL()
switch url.Scheme {
case "http", "https":
{
serviceResult, status = CheckHTTP200(ctx, url.String())
break
}
serviceResult, status = CheckHTTP200(ctx, url.String())
case "tcp":
{
// go includes port in host
serviceResult, status = CheckTCPOpen(ctx, url.Host)
break
}
// go includes port in host (url.Host is actually "authority")
serviceResult, status = CheckTCPOpen(ctx, url.Host)
case "icmp":
{
// go includes port in host
serviceResult, status = CheckICMPUp(ctx, url.Host)
break
}
// go includes port in host (url.Host is actually "authority")
serviceResult, status = CheckICMPUp(ctx, url.Host)
default:
log.Panicf("I can't handle service with scheme: %#v", url.Scheme)
break
}
return ServiceStatus{