aboutsummaryrefslogtreecommitdiff
path: root/internal/monitor/tcp.go
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-01-19 04:17:50 -0800
committerFuwn <[email protected]>2026-01-19 04:17:50 -0800
commit1e96ec397d38e6263c5369d91f2579092c9c9390 (patch)
treeb4b73accb870de9178acc931443c8cd474423fa5 /internal/monitor/tcp.go
parentfeat: Add browser timezone option for client-side time display (diff)
downloadkaze-1e96ec397d38e6263c5369d91f2579092c9c9390.tar.xz
kaze-1e96ec397d38e6263c5369d91f2579092c9c9390.zip
feat: Add retry option for monitor checks
Diffstat (limited to 'internal/monitor/tcp.go')
-rw-r--r--internal/monitor/tcp.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/monitor/tcp.go b/internal/monitor/tcp.go
index f93ae10..d315545 100644
--- a/internal/monitor/tcp.go
+++ b/internal/monitor/tcp.go
@@ -15,6 +15,7 @@ type TCPMonitor struct {
target string
interval time.Duration
timeout time.Duration
+ retries int
}
// NewTCPMonitor creates a new TCP monitor
@@ -30,6 +31,7 @@ func NewTCPMonitor(cfg config.MonitorConfig) (*TCPMonitor, error) {
target: cfg.Target,
interval: cfg.Interval.Duration,
timeout: cfg.Timeout.Duration,
+ retries: cfg.Retries,
}, nil
}
@@ -53,6 +55,11 @@ func (m *TCPMonitor) Interval() time.Duration {
return m.interval
}
+// Retries returns the number of retry attempts
+func (m *TCPMonitor) Retries() int {
+ return m.retries
+}
+
// Check performs the TCP connection check
func (m *TCPMonitor) Check(ctx context.Context) *Result {
result := &Result{