Documentation
¶
Index ¶
- func FormatMessage(p *Payload) string
- type DiscordSender
- type DiscordSettings
- type Dispatcher
- func (d *Dispatcher) NotifyChannels(channelIDs []int64, payload *Payload)
- func (d *Dispatcher) NotifyForMonitor(monitorID int64, payload *Payload)
- func (d *Dispatcher) NotifyWithPayload(payload *Payload)
- func (d *Dispatcher) RegisterSender(s Sender)
- func (d *Dispatcher) SendTest(ch *storage.NotificationChannel, inc *storage.Incident) error
- type EmailSender
- type EmailSettings
- type GoogleChatSender
- type GoogleChatSettings
- type GotifySender
- type GotifySettings
- type MatrixSender
- type MatrixSettings
- type NtfySender
- type NtfySettings
- type OpsgenieSender
- type OpsgenieSettings
- type PagerDutySender
- type PagerDutySettings
- type Payload
- type PushoverSender
- type PushoverSettings
- type Sender
- type SlackSender
- type SlackSettings
- type SubscriberEvent
- type SubscriberNotifier
- type TeamsSender
- type TeamsSettings
- type TelegramSender
- type TelegramSettings
- type WebhookSender
- type WebhookSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatMessage ¶
Types ¶
type DiscordSender ¶
type DiscordSender struct {
AllowPrivate bool
}
func (*DiscordSender) Send ¶
func (s *DiscordSender) Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
func (*DiscordSender) Type ¶
func (s *DiscordSender) Type() string
type DiscordSettings ¶
type DiscordSettings struct {
WebhookURL string `json:"webhook_url"`
}
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func (*Dispatcher) NotifyChannels ¶ added in v1.2.0
func (d *Dispatcher) NotifyChannels(channelIDs []int64, payload *Payload)
NotifyChannels sends a notification to specific channels by ID, bypassing event subscription filters.
func (*Dispatcher) NotifyForMonitor ¶
func (d *Dispatcher) NotifyForMonitor(monitorID int64, payload *Payload)
func (*Dispatcher) NotifyWithPayload ¶
func (d *Dispatcher) NotifyWithPayload(payload *Payload)
func (*Dispatcher) RegisterSender ¶
func (d *Dispatcher) RegisterSender(s Sender)
func (*Dispatcher) SendTest ¶
func (d *Dispatcher) SendTest(ch *storage.NotificationChannel, inc *storage.Incident) error
type EmailSender ¶
type EmailSender struct{}
func (*EmailSender) Send ¶
func (s *EmailSender) Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
func (*EmailSender) Type ¶
func (s *EmailSender) Type() string
type EmailSettings ¶
type EmailSettings struct {
Host string `json:"host"`
Port int `json:"port"`
Username string `json:"username"`
Password string `json:"password"`
From string `json:"from"`
To []string `json:"to"`
CC []string `json:"cc,omitempty"`
BCC []string `json:"bcc,omitempty"`
TLSMode string `json:"tls_mode,omitempty"` // none, starttls (default), smtps
}
type GoogleChatSender ¶ added in v1.2.0
type GoogleChatSender struct {
AllowPrivate bool
}
func (*GoogleChatSender) Send ¶ added in v1.2.0
func (s *GoogleChatSender) Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
func (*GoogleChatSender) Type ¶ added in v1.2.0
func (s *GoogleChatSender) Type() string
type GoogleChatSettings ¶ added in v1.2.0
type GoogleChatSettings struct {
WebhookURL string `json:"webhook_url"`
}
type GotifySender ¶ added in v1.2.0
type GotifySender struct {
AllowPrivate bool
}
func (*GotifySender) Send ¶ added in v1.2.0
func (s *GotifySender) Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
func (*GotifySender) Type ¶ added in v1.2.0
func (s *GotifySender) Type() string
type GotifySettings ¶ added in v1.2.0
type MatrixSender ¶ added in v1.2.0
type MatrixSender struct {
AllowPrivate bool
}
func (*MatrixSender) Send ¶ added in v1.2.0
func (s *MatrixSender) Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
func (*MatrixSender) Type ¶ added in v1.2.0
func (s *MatrixSender) Type() string
type MatrixSettings ¶ added in v1.2.0
type NtfySender ¶
type NtfySender struct {
AllowPrivate bool
}
func (*NtfySender) Send ¶
func (s *NtfySender) Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
func (*NtfySender) Type ¶
func (s *NtfySender) Type() string
type NtfySettings ¶
type OpsgenieSender ¶ added in v1.2.0
type OpsgenieSender struct{}
func (*OpsgenieSender) Send ¶ added in v1.2.0
func (s *OpsgenieSender) Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
func (*OpsgenieSender) Type ¶ added in v1.2.0
func (s *OpsgenieSender) Type() string
type OpsgenieSettings ¶ added in v1.2.0
type PagerDutySender ¶ added in v1.2.0
type PagerDutySender struct{}
func (*PagerDutySender) Send ¶ added in v1.2.0
func (s *PagerDutySender) Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
func (*PagerDutySender) Type ¶ added in v1.2.0
func (s *PagerDutySender) Type() string
type PagerDutySettings ¶ added in v1.2.0
type PagerDutySettings struct {
RoutingKey string `json:"routing_key"`
}
type Payload ¶
type Payload struct {
EventType string `json:"event_type"`
Incident *storage.Incident `json:"incident,omitempty"`
Monitor *storage.Monitor `json:"monitor,omitempty"`
Change *storage.ContentChange `json:"change,omitempty"`
EscalationStep int `json:"escalation_step,omitempty"`
EscalationTotal int `json:"escalation_total,omitempty"`
}
Payload contains the notification data.
type PushoverSender ¶ added in v1.2.0
type PushoverSender struct{}
func (*PushoverSender) Send ¶ added in v1.2.0
func (s *PushoverSender) Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
func (*PushoverSender) Type ¶ added in v1.2.0
func (s *PushoverSender) Type() string
type PushoverSettings ¶ added in v1.2.0
type Sender ¶
type Sender interface {
Type() string
Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
}
Sender sends a notification via a specific channel type.
type SlackSender ¶
type SlackSender struct {
AllowPrivate bool
}
func (*SlackSender) Send ¶
func (s *SlackSender) Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
func (*SlackSender) Type ¶
func (s *SlackSender) Type() string
type SlackSettings ¶
type SubscriberEvent ¶ added in v1.2.0
type SubscriberEvent struct {
Event string `json:"event"`
StatusPage struct {
ID int64 `json:"id"`
Title string `json:"title"`
Slug string `json:"slug"`
} `json:"status_page"`
Monitor *subscriberMonitor `json:"monitor,omitempty"`
Incident *subscriberIncident `json:"incident,omitempty"`
Time string `json:"timestamp"`
}
type SubscriberNotifier ¶ added in v1.2.0
type SubscriberNotifier struct {
// contains filtered or unexported fields
}
func NewSubscriberNotifier ¶ added in v1.2.0
func NewSubscriberNotifier(store storage.Store, smtpCfg config.SMTPConfig, extURL string, logger *slog.Logger, allowPrivate bool) *SubscriberNotifier
func (*SubscriberNotifier) NotifyForMonitor ¶ added in v1.2.0
func (*SubscriberNotifier) SendConfirmationEmail ¶ added in v1.2.0
func (n *SubscriberNotifier) SendConfirmationEmail(ctx context.Context, sub *storage.StatusPageSubscriber, sp *storage.StatusPage) error
type TeamsSender ¶ added in v1.2.0
type TeamsSender struct {
AllowPrivate bool
}
func (*TeamsSender) Send ¶ added in v1.2.0
func (s *TeamsSender) Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
func (*TeamsSender) Type ¶ added in v1.2.0
func (s *TeamsSender) Type() string
type TeamsSettings ¶ added in v1.2.0
type TeamsSettings struct {
WebhookURL string `json:"webhook_url"`
}
type TelegramSender ¶
type TelegramSender struct{}
func (*TelegramSender) Send ¶
func (s *TelegramSender) Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
func (*TelegramSender) Type ¶
func (s *TelegramSender) Type() string
type TelegramSettings ¶
type WebhookSender ¶
type WebhookSender struct {
AllowPrivate bool
}
func (*WebhookSender) Send ¶
func (s *WebhookSender) Send(ctx context.Context, channel *storage.NotificationChannel, payload *Payload) error
func (*WebhookSender) Type ¶
func (s *WebhookSender) Type() string
type WebhookSettings ¶
type WebhookSettings struct {
URL string `json:"url"`
Secret string `json:"secret,omitempty"` // HMAC-SHA256 signing secret
}
WebhookSettings holds webhook-specific configuration.
Click to show internal directories.
Click to hide internal directories.