Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendWebhookAlert ¶
func SendWebhookAlert(webhookURL string, payload WebhookPayload, timeout time.Duration) error
SendWebhookAlert dispatches a JSON POST payload to a configured webhook URL with SSRF validation and retries.
Types ¶
type NotificationEngine ¶
type NotificationEngine struct{}
NotificationEngine manages multi-channel alert dispatches for incidents.
func NewNotificationEngine ¶
func NewNotificationEngine() *NotificationEngine
NewNotificationEngine creates a new NotificationEngine.
func (*NotificationEngine) NotifyIncidentCreated ¶
func (n *NotificationEngine) NotifyIncidentCreated(monitor db.Monitor, incident db.Incident, webhookURL string)
NotifyIncidentCreated triggers real-time alerts when a new outage incident opens.
func (*NotificationEngine) NotifyIncidentResolved ¶
func (n *NotificationEngine) NotifyIncidentResolved(monitor db.Monitor, incident db.Incident, webhookURL string)
NotifyIncidentResolved triggers real-time alerts when an outage incident resolves.
type WebhookError ¶
type WebhookError string
func (WebhookError) Error ¶
func (e WebhookError) Error() string
type WebhookPayload ¶
type WebhookPayload struct {
Event string `json:"event"` // "incident.open" or "incident.resolved"
MonitorID string `json:"monitor_id"` // Target monitor UUID
MonitorName string `json:"monitor_name"` // Target monitor name
TargetURL string `json:"target_url"` // Target URL
Status string `json:"status"` // "DOWN" or "UP"
Cause string `json:"cause"` // Outage cause description
Timestamp string `json:"timestamp"` // ISO-8601 timestamp
}
WebhookPayload represents the JSON notification format dispatched to external webhooks.
Click to show internal directories.
Click to hide internal directories.