Documentation
¶
Overview ¶
Package alerts provides set of API to send system and services alerts
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertSender ¶
type AlertSender interface {
SendAlert(alert interface{})
}
AlertSender alerts sender.
type Config ¶
type Config struct { Filter []string `json:"filter"` ServiceAlertPriority int `json:"serviceAlertPriority"` SystemAlertPriority int `json:"systemAlertPriority"` }
Config alerts configuration.
type CursorStorage ¶
type CursorStorage interface { SetJournalCursor(cursor string) (err error) GetJournalCursor() (cursor string, err error) }
CursorStorage provides API to set and get journal cursor.
type InstanceInfoProvider ¶
type InstanceInfoProvider interface {
GetInstanceInfoByID(instanceID string) (ident aostypes.InstanceIdent, version string, err error)
}
InstanceInfoProvider provides instance info.
type JournalAlerts ¶
JournalAlerts instance.
func New ¶
func New( config Config, instanceProvider InstanceInfoProvider, cursorStorage CursorStorage, sender AlertSender, ) (instance *JournalAlerts, err error)
New creates new journal alerts object.
type JournalInterface ¶
type JournalInterface interface { Close() error AddMatch(match string) error AddDisjunction() error SeekTail() error Previous() (uint64, error) SeekCursor(cursor string) error Next() (uint64, error) GetEntry() (*sdjournal.JournalEntry, error) Wait(timeout time.Duration) int GetCursor() (string, error) }
JournalInterface systemd journal interface.
var SDJournal JournalInterface //nolint:gochecknoglobals
SDJournal is using to mock systemd journal in unit tests.
Click to show internal directories.
Click to hide internal directories.