Files
vastly/api/latency.go
2024-12-16 21:04:05 -06:00

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
}