1
0
mirror of https://github.com/nikoksr/notify.git synced 2024-11-24 08:22:18 +02:00
notify/notify.go

30 lines
794 B
Go

//go:generate go install github.com/golangci/golangci-lint/cmd/golangci-lint
//go:generate go install mvdan.cc/gofumpt/gofumports
//go:generate go install github.com/daixiang0/gci
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
}