From d81c525d71b60ae0fa685fa0be403f4ab4fa85f8 Mon Sep 17 00:00:00 2001 From: Emanuel Bennici Date: Fri, 4 Oct 2019 17:18:33 +0200 Subject: [PATCH] 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. --- types/service.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/service.go b/types/service.go index f607064e..a904f980 100644 --- a/types/service.go +++ b/types/service.go @@ -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"`