mirror of
https://github.com/Xevion/vastly.git
synced 2025-12-07 20:08:56 -06:00
line endings change fix, misc
This commit is contained in:
18
api/latency.go
Normal file
18
api/latency.go
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user