-
-
Notifications
You must be signed in to change notification settings - Fork 655
Notifier Events
Hunter Long edited this page May 1, 2020
·
2 revisions
Events are handled by added interfaces for the elements you want to monitor.
// Notifier interface is required to create a new Notifier
type Notifier interface {
// OnSuccess is triggered when a service is successful
OnSuccess(*services.Service) error
// OnFailure is triggered when a service is failing
OnFailure(*services.Service, *failures.Failure) error
// OnTest is triggered for testing
OnTest() (string, error)
}
// BasicEvents includes the most minimal events, failing and successful service triggers
type BasicEvents interface {
// OnSuccess is triggered when a service is successful
OnSuccess(*types.Service)
// OnFailure is triggered when a service is failing
OnFailure(*types.Service, *types.Failure)
}
// ServiceEvents are events for Services
type ServiceEvents interface {
OnNewService(*types.Service)
OnUpdatedService(*types.Service)
OnDeletedService(*types.Service)
}
// UserEvents are events for Users
type UserEvents interface {
OnNewUser(*types.User)
OnUpdatedUser(*types.User)
OnDeletedUser(*types.User)
}
// CoreEvents are events for the main Core app
type CoreEvents interface {
OnUpdatedCore(*types.Core)
}
// NotifierEvents are events for other Notifiers
type NotifierEvents interface {
OnNewNotifier(*Notification)
OnUpdatedNotifier(*Notification)
}
Statping.com | Demo | Docker | Notifiers | API
Email: info@statping.com