2020-03-04 10:29:00 +00:00
|
|
|
package notifiers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2020-03-12 04:58:56 +00:00
|
|
|
"github.com/statping/statping/types/services"
|
2020-03-04 10:29:00 +00:00
|
|
|
)
|
|
|
|
|
2020-03-14 03:13:20 +00:00
|
|
|
func InitNotifiers() {
|
|
|
|
Add(
|
|
|
|
slacker,
|
2020-03-12 08:09:25 +00:00
|
|
|
Command,
|
|
|
|
Discorder,
|
2020-03-14 03:13:20 +00:00
|
|
|
email,
|
2020-03-12 08:09:25 +00:00
|
|
|
LineNotify,
|
|
|
|
Telegram,
|
|
|
|
Twilio,
|
|
|
|
Webhook,
|
2020-03-14 03:13:20 +00:00
|
|
|
Mobile,
|
2020-03-04 10:29:00 +00:00
|
|
|
)
|
|
|
|
}
|
2020-03-14 03:13:20 +00:00
|
|
|
|
|
|
|
func Add(notifs ...services.ServiceNotifier) {
|
|
|
|
for _, n := range notifs {
|
|
|
|
services.AddNotifier(n)
|
|
|
|
if err := n.Select().Create(); err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|