From 4688b1bd3d42e01283fdc713ab7cc411c49aacb5 Mon Sep 17 00:00:00 2001 From: Hunter Long Date: Wed, 26 Sep 2018 11:12:07 -0700 Subject: [PATCH] Updated Notifiers (markdown) --- Notifiers.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Notifiers.md b/Notifiers.md index 963ade0..30d4a7a 100644 --- a/Notifiers.md +++ b/Notifiers.md @@ -1,4 +1,6 @@ - +

+ +

Statup includes multiple Notifiers to alert you when your services are offline. You can also create your own notifier and send a Push Request to this repo! Creating a custom notifier is pretty easy as long as you follow the requirements. A notifier will automatically be installed into the users Statup database, and form values will save without any hassles. 💃 @@ -12,7 +14,7 @@ Statup includes multiple Notifiers to alert you when your services are offline. - Must create and add your notifier variable in `init()` - Should have a form for user to input their variables/keys. `Form: []notifier.NotificationForm` -## Notifier Interface +## Notifier Interface (required) Statup has the `Notifier` interface which you'll need to include in your notifier. Statup includes many other events/triggers for your notifier, checkout Notifier Events to see all of them. ```go // Notifier interface is required to create a new Notifier @@ -23,7 +25,8 @@ type Notifier interface { } ``` -Include `OnSuccess` and `OnFailure` to receive triggers when a service is online or offline. +### Basic Interface (required) +Include `OnSuccess` and `OnFailure` to receive events when a service is online or offline. ```go // BasicEvents includes the most minimal events, failing and successful service triggers type BasicEvents interface { @@ -34,13 +37,15 @@ type BasicEvents interface { } ``` -The OnTest method will give the front end user the ability to test your notifier without saving. +### Test Interface +The OnTest method will give the front end user the ability to test your notifier without saving, the OnTest method for your notifier run the functionality to test the user's submitted parameters and respond an error if notifier is not correctly setup. ```go // Tester interface will include a function to Test users settings before saving type Tester interface { - OnTest(Notification) (bool, error) + OnTest() error } ``` +If your notifier includes this interface, the Test button will appear. ## Notifier Struct ```go