mirror of
https://github.com/Xevion/vastly.git
synced 2025-12-05 23:16:48 -06:00
19 lines
279 B
Go
19 lines
279 B
Go
package api
|
|
|
|
import probing "github.com/prometheus-community/pro-bing"
|
|
|
|
type PingResult struct {
|
|
Ip string
|
|
Latency float64
|
|
}
|
|
|
|
func GetLatency(ip string) (float64, error) {
|
|
pinger, err := probing.NewPinger(ip)
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
|
|
pinger
|
|
return 0, nil
|
|
}
|