Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { // ID is a unique identifier for the alert. ID types.Hash256 `json:"id"` // Severity is the severity of the alert. Severity Severity `json:"severity"` // Message is a human-readable message describing the alert. Message string `json:"message"` // Data is a map of arbitrary data that can be used to provide // additional context to the alert. Data map[string]any `json:"data,omitempty"` Timestamp time.Time `json:"timestamp"` }
An Alert is a dismissible message that is displayed to the user.
type EventReporter ¶ added in v1.0.0
An EventReporter broadcasts events to subscribers.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
A Manager manages the host's alerts.
func NewManager ¶
func NewManager(er EventReporter, log *zap.Logger) *Manager
NewManager initializes a new alerts manager.
type Severity ¶
type Severity uint8
Severity indicates the severity of an alert.
const ( // SeverityInfo indicates that the alert is informational. SeverityInfo Severity = iota + 1 // SeverityWarning indicates that the alert is a warning. SeverityWarning // SeverityError indicates that the alert is an error. SeverityError // SeverityCritical indicates that the alert is critical. SeverityCritical )
func (Severity) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Severity) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
Click to show internal directories.
Click to hide internal directories.