Documentation
¶
Index ¶
- type Alert
- type AlertCollection
- type AlertType
- type Manager
- func (m *Manager) AddAlert(alert Alert) error
- func (m *Manager) CleanupExpired() int
- func (m *Manager) ClearAlerts()
- func (m *Manager) GetActiveAlertCount() int
- func (m *Manager) GetAlert(id string) (*Alert, error)
- func (m *Manager) GetAlertCount() int
- func (m *Manager) ListActiveAlerts() []Alert
- func (m *Manager) ListAlerts() []Alert
- func (m *Manager) LoadFromJSON(data []byte) error
- func (m *Manager) RemoveAlert(id string) error
- func (m *Manager) ToJSON() ([]byte, error)
- func (m *Manager) UpdateAlert(id string, updatedAlert Alert) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
ID string `json:"id"`
Type AlertType `json:"type"`
Title string `json:"title,omitempty"`
Message string `json:"message"`
Dismissible bool `json:"dismissible"`
Created time.Time `json:"created"`
Expires *time.Time `json:"expires,omitempty"`
}
Alert represents a single maintenance alert.
type AlertCollection ¶
type AlertCollection struct {
Alerts []Alert `json:"alerts"`
}
AlertCollection represents the complete alerts configuration.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles alert operations.
func (*Manager) CleanupExpired ¶
CleanupExpired removes all expired alerts.
func (*Manager) GetActiveAlertCount ¶
GetActiveAlertCount returns the number of active alerts.
func (*Manager) GetAlertCount ¶
GetAlertCount returns the total number of alerts.
func (*Manager) ListActiveAlerts ¶
ListActiveAlerts returns only active (non-expired) alerts.
func (*Manager) LoadFromJSON ¶
LoadFromJSON loads alerts from JSON data.
func (*Manager) RemoveAlert ¶
RemoveAlert removes an alert by ID.
Click to show internal directories.
Click to hide internal directories.