Documentation
¶
Overview ¶
Package alert handles multi-channel alerting
Index ¶
- type Alert
- type Channel
- type DesktopChannel
- type DiscordChannel
- type Level
- type Manager
- func (m *Manager) List(limit int, unreadOnly bool) []*Alert
- func (m *Manager) MarkAllRead()
- func (m *Manager) MarkRead(id string)
- func (m *Manager) OnAlert(fn func(*Alert))
- func (m *Manager) Send(ctx context.Context, alert *Alert) error
- func (m *Manager) SendAgentEvent(ctx context.Context, event agent.Event) error
- func (m *Manager) UnreadCount() int
- type SlackChannel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
ID string
Level Level
Title string
Message string
AgentID string
Agent agent.Agent
Timestamp time.Time
Read bool
}
Alert represents an alert message
type DesktopChannel ¶
type DesktopChannel struct{}
DesktopChannel sends desktop notifications
func (*DesktopChannel) Name ¶
func (c *DesktopChannel) Name() string
type DiscordChannel ¶
type DiscordChannel struct {
// contains filtered or unexported fields
}
DiscordChannel sends Discord notifications
func (*DiscordChannel) Name ¶
func (c *DiscordChannel) Name() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages alert channels and distribution
func NewManager ¶
func NewManager(cfg *config.AlertsConfig, st *store.Store) *Manager
NewManager creates a new alert manager
func (*Manager) SendAgentEvent ¶
SendAgentEvent sends an alert for an agent event
func (*Manager) UnreadCount ¶
UnreadCount returns the number of unread alerts
type SlackChannel ¶
type SlackChannel struct {
// contains filtered or unexported fields
}
SlackChannel sends Slack notifications
func (*SlackChannel) Name ¶
func (c *SlackChannel) Name() string
Click to show internal directories.
Click to hide internal directories.