chore: wails update, dependencies update, ping test cmd, pnpm

This commit is contained in:
Ryan Walters
2025-08-23 19:02:04 -05:00
parent 63208ee203
commit b3eb8d7d8f
9 changed files with 365 additions and 348 deletions

39
cmd/test.go Normal file
View File

@@ -0,0 +1,39 @@
package main
import (
"time"
probing "github.com/prometheus-community/pro-bing"
"go.uber.org/zap"
)
func main() {
logger, _ := zap.NewDevelopment()
sugar := logger.Sugar()
ip := "195.0.159.206"
sugar.Info("Starting pinger")
pinger, err := probing.NewPinger(ip)
if err != nil {
sugar.Fatal("Failed to create pinger")
}
pinger.SetPrivileged(true)
pinger.Timeout = time.Millisecond * 500
pinger.Count = 1
pinger.Interval = time.Nanosecond
sugar.Info("Running pinger")
err = pinger.Run()
if err != nil {
sugar.Fatalw("Failed to run pinger", "error", err)
}
sugar.Info("Pinger finished")
result := pinger.Statistics()
if result.PacketLoss > 0 {
sugar.Warnw("Ping Failed", "ip", ip, "packetLoss", result.PacketLoss)
} else {
sugar.Infow("Ping Successful", "ip", ip, "latency", result.AvgRtt)
}
}