2017-06-16 10:33:35 +02:00
|
|
|
package notify
|
|
|
|
|
|
|
|
import (
|
2017-10-25 00:36:16 +02:00
|
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
|
2017-08-11 17:45:42 +02:00
|
|
|
"github.com/genofire/logmania/bot"
|
2017-06-16 10:33:35 +02:00
|
|
|
"github.com/genofire/logmania/lib"
|
2017-08-11 17:45:42 +02:00
|
|
|
configNotify "github.com/genofire/logmania/notify/config"
|
2017-06-16 10:33:35 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var NotifyRegister []NotifyInit
|
|
|
|
|
|
|
|
type Notifier interface {
|
2017-10-25 00:36:16 +02:00
|
|
|
Fire(entry *log.Entry) error
|
|
|
|
Levels() []log.Level
|
2017-06-16 10:33:35 +02:00
|
|
|
Close()
|
|
|
|
}
|
|
|
|
|
2017-08-11 17:45:42 +02:00
|
|
|
type NotifyInit func(*lib.NotifyConfig, *configNotify.NotifyState, *bot.Bot) Notifier
|
2017-06-16 10:33:35 +02:00
|
|
|
|
|
|
|
func AddNotifier(n NotifyInit) {
|
|
|
|
NotifyRegister = append(NotifyRegister, n)
|
|
|
|
}
|