aboutsummaryrefslogtreecommitdiff
path: root/internal/monitor/http.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/http.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/http.go')
-rw-r--r--internal/monitor/http.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/monitor/http.go b/internal/monitor/http.go
index 8432401..5587a5f 100644
--- a/internal/monitor/http.go
+++ b/internal/monitor/http.go
@@ -20,6 +20,7 @@ type HTTPMonitor struct {
target string
interval time.Duration
timeout time.Duration
+ retries int
method string
headers map[string]string
body string
@@ -81,6 +82,7 @@ func NewHTTPMonitor(cfg config.MonitorConfig) (*HTTPMonitor, error) {
target: target,
interval: cfg.Interval.Duration,
timeout: cfg.Timeout.Duration,
+ retries: cfg.Retries,
method: cfg.Method,
headers: cfg.Headers,
body: cfg.Body,
@@ -110,6 +112,11 @@ func (m *HTTPMonitor) Interval() time.Duration {
return m.interval
}
+// Retries returns the number of retry attempts
+func (m *HTTPMonitor) Retries() int {
+ return m.retries
+}
+
// Check performs the HTTP/HTTPS check
func (m *HTTPMonitor) Check(ctx context.Context) *Result {
result := &Result{