Documentation ¶
Index ¶
Constants ¶
View Source
const HardRestartMessage = "__hard_restart"
View Source
const SoftRestartMessage = "__soft_reload"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EventConsumer ¶ added in v0.6.0
type EventConsumer interface {
Notify(n Notification) error
}
type Notification ¶
type Notification struct { ID string `json:"id" db:"id"` // snowflake Date time.Time `json:"createdAt" db:"created_at"` ChildProccessID string `json:"childProcessId" db:"child_process_id"` // snowflake Type NotificationType `json:"type" db:"event_type"` Message string `json:"message" db:"event_data"` }
type NotificationCallback ¶ added in v0.6.0
type NotificationCallback func(n Notification) error
type NotificationType ¶
type NotificationType int
const ( NotificationTypeSystemError NotificationType = iota NotificationTypeSoftRestartRequested NotificationTypeHardRestartRequested NotificationTypeOOBTaskRequested NotificationTypeShutdownRequested NotificationTypeSystemShutdown NotificationTypeStartup NotificationTypeHardRestart NotificationTypeSoftRestart NotificationTypeShutdown NotificationTypeLogEvent NotificationTypeStdOut NotificationTypeStdErr NotificationTypeOOBTaskStartup NotificationTypeOOBTaskStdOut NotificationTypeOOBTaskStdErr NotificationTypeIPC )
type Notifier ¶ added in v0.6.0
type Notifier struct {
// contains filtered or unexported fields
}
func NewNotifier ¶ added in v0.6.0
func NewNotifier(callbackFn NotificationCallback) (*Notifier, error)
func (*Notifier) Notify ¶ added in v0.6.0
func (n *Notifier) Notify(notif Notification) error
func (*Notifier) SendSoftRestart ¶ added in v0.6.1
Click to show internal directories.
Click to hide internal directories.