Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { // Level defines the level of the alert Level Level `json:"level"` // Message describes the alert Message string `json:"message"` // ObjectRef defines the k8s object designated by the alert ObjectRef ObjectRef `json:"objectRef"` // Source defines the source of the alert Source string `json:"source"` // When defines when the alert has been created When int64 `json:"when"` }
Alert contains the information about the alert
type KafkaConfig ¶
type Level ¶
type Level uint8
Level defines the level of an alert, it is an enum of UNKNOWN, INFO, WARN, ERROR
func (Level) MarshalJSON ¶
MarshalJSON marshals the enum as a quoted json string
func (*Level) UnmarshalJSON ¶
UnmarshalJSON unmashals a quoted json string to the enum value
type Notifier ¶
type Notifier interface { // Send sends the alert to the external system Send(alert Alert) error // Close closes the notifier Close() error }
Notifier is responsible to send an alert to an external system
func NewKafkaNotifier ¶
func NewKafkaNotifier(topic string, producer sarama.SyncProducer) Notifier
func NewLogNotifier ¶
func NewLogNotifier(logger *zap.SugaredLogger) Notifier
NewLogNotifier returns a Notifier that generate logs using the passed logger
Click to show internal directories.
Click to hide internal directories.