summaryrefslogtreecommitdiff
path: root/internal/failover/monitor.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-02-12 19:18:05 +0100
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-02-19 14:15:07 +0100
commit74e36f0ead717105f26087c2cab08b41ba5a7ce8 (patch)
tree1eb2b7516bea705c9b5a50ce0965e170414ed880 /internal/failover/monitor.go
parent682d70091af2044ff6d8b350da9dff13163232e2 (diff)
All: Document everything to pass revive lint
Diffstat (limited to 'internal/failover/monitor.go')
-rw-r--r--internal/failover/monitor.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/failover/monitor.go b/internal/failover/monitor.go
index d9028f2..5d81f22 100644
--- a/internal/failover/monitor.go
+++ b/internal/failover/monitor.go
@@ -20,6 +20,10 @@ type DroppedConMon struct {
readRxBytes func() (int64, error)
}
+// NewDroppedMonitor creates a new failover monitor
+// `pingInterval` is the interval in which to send pings
+// `pDropped` is how many pings we need to send before we deem it is dropped
+// `readRxBytes` is a function that gets the rx bytes from the client
func NewDroppedMonitor(pingInterval time.Duration, pDropped int, readRxBytes func() (int64, error)) *DroppedConMon {
return &DroppedConMon{pInterval: pingInterval, pDropped: pDropped, readRxBytes: readRxBytes}
}