1
0
mirror of https://github.com/nikoksr/notify.git synced 2024-12-12 10:13:59 +02:00
notify/notify.go

27 lines
614 B
Go

package notify
import (
"github.com/pkg/errors"
)
const defaultDisabled = false // Notifier is enabled by default
// Notify is the central struct for managing notification services and sending messages to them.
type Notify struct {
Disabled bool
notifiers []Notifier
}
// ErrSendNotification signals that the notifier failed to send a notification.
var ErrSendNotification = errors.New("send notification")
// New returns a new instance of Notify. Defaulting to being not disabled.
func New() *Notify {
notifier := &Notify{
Disabled: defaultDisabled,
notifiers: []Notifier{},
}
return notifier
}