repo init
This commit is contained in:
commit
7e44db87b2
48 files changed
+5346
No files matched your search
@@ -0,0 +1,39 @@
|
||||
// Command prober runs on one of the external test sites. It polls the
|
||||
// Control API for the set of floating IPs currently under test and probes
|
||||
// each directly (TCP connect + ICMP echo) to measure inbound reachability
|
||||
// from this vantage point.
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"log/slog"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"cloudipvalidator/internal/config"
|
||||
"cloudipvalidator/internal/probercore"
|
||||
)
|
||||
|
||||
func main() {
|
||||
configPath := flag.String("config", "configs/prober.yaml", "path to prober config file")
|
||||
flag.Parse()
|
||||
|
||||
log := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: slog.LevelInfo}))
|
||||
|
||||
cfg, err := config.LoadProber(*configPath)
|
||||
if err != nil {
|
||||
log.Error("load config", "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
||||
defer stop()
|
||||
|
||||
prober := probercore.New(cfg, log)
|
||||
if err := prober.Run(ctx); err != nil && err != context.Canceled {
|
||||
log.Error("prober stopped", "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user