Add new Fields to `Service` Struct

Add `UpdateNotify` Field to allow the Notifiers to check if
`UpdateNotify` has been enabled in `CoreApp`.

Add `DownText` Field to have a default Downtime Text which also has the
'Service has been down for n-Seconds' Text.

Add `SuccessNotified` Field to check if a "Success" Message has already
been send.
This is because the `s.Online` Field is always "false" if the
OnSuccess() Function is called of an Notifier.
pull/258/head
Emanuel Bennici 2019-10-04 17:18:33 +02:00
parent 786bfe75fc
commit d81c525d71
No known key found for this signature in database
GPG Key ID: 17FA2D56BAD01661
1 changed files with 4 additions and 1 deletions

View File

@ -50,7 +50,10 @@ type Service struct {
Checkpoint time.Time `gorm:"-" json:"-"`
SleepDuration time.Duration `gorm:"-" json:"-"`
LastResponse string `gorm:"-" json:"-"`
UserNotified bool `gorm:"-" json:"-"` /// True if the User was already notified about a Downtime
UserNotified bool `gorm:"-" json:"-"` // True if the User was already notified about a Downtime
UpdateNotify bool `gorm:"-" json:"-"` // This Variable is a simple copy of `core.CoreApp.UpdateNotify.Bool`
DownText string `gorm:"-" json:"-"` // Contains the current generated Downtime Text
SuccessNotified bool `gorm:"-" json:"-"` // Is 'true' if the user has already be informed that the Services now again available
LastStatusCode int `gorm:"-" json:"status_code"`
LastOnline time.Time `gorm:"-" json:"last_success"`
Failures []FailureInterface `gorm:"-" json:"failures,omitempty"`