Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotify = errors.New("notify error")
ErrNotify is notify error.
Functions ¶
This section is empty.
Types ¶
type Combine ¶
type Combine struct {
// contains filtered or unexported fields
}
Combine impl notifier, can combine multi notifiers to one.
func NewCombine ¶
NewCombine create a instance from other notifiers.
func (*Combine) Close ¶
Close impl Notifier.Close. It return multierr, use multierr.Errors unwrap to multi errors slice.
type Ding ¶
type Ding struct { NoopCloser NoopWaiter // contains filtered or unexported fields }
Ding impl notifier, notify msg by Dingding webhook.
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter impl notifier, can add a interval between messages. Limiter run a background goroutine to handle message notify.
func NewLimiter ¶
NewLimiter create a instance.
func (*Limiter) GetErrorCh ¶
GetErrorCh return error message channel.
type Mailer ¶
type Mailer struct { NoopCloser NoopWaiter // contains filtered or unexported fields }
Mailer impl notifier, notify msg by mailgun API.
type Message ¶
Message is notify msg type.
func MessageFromContent ¶
MessageFromContent is a helper function creating a message from content and some options.
type Notifier ¶
type Notifier interface { // GetName return notifier type name GetName() string // Notify notify msg Notify(ctx context.Context, to string, msg Message) error // Close close notifier Close() error Wait() }
Notifier is Notify interface.
type Printer ¶
type Printer struct { NoopWaiter // contains filtered or unexported fields }
Printer impl notifier, notify msg to a io.Writer.
type Telegram ¶
type Telegram struct { NoopWaiter // contains filtered or unexported fields }
Telegram impl notifier, notify msg by telegram bot.
func NewTelegram ¶
NewTelegram create a instance.