chore: update readme

This commit is contained in:
2023-04-28 17:06:08 +02:00
parent 2130b3b3dd
commit 7974d0f3fd
3 changed files with 155 additions and 140 deletions

10
icmp.go
View File

@@ -31,22 +31,22 @@ type ICMPMonitor struct {
// CheckICMPAlive func
func CheckICMPAlive(ip string, timeout int) (bool, error) {
pg, err := yap.NewPinger();
pg, err := yap.NewPinger()
if err != nil {
defer pg.Close()
}
response := pg.Call(yap.Request{
Target: ip,
Count: 1,
Target: ip,
Count: 1,
Timeout: timeout * 1000})
if response.Error != nil {
return false, response.Error
} else {
return true, nil
}
return true, nil
}
// test if it available