Releases: moonD4rk/notifier
Releases · moonD4rk/notifier
notifier-v0.3.0
First release in three years — major API refresh with breaking changes.
What's new
Sendis now context-aware:Send(ctx, notifier.Message)- Exported
notifier.Providerinterface — plug in custom channels viaWithProvider - Two new channels: Telegram (
WithTelegram) and WeCom (WithWeCom) - Structured errors:
*notifier.MultiErrorwith per-provider attribution Message.Extrasfor channel-specific options (@mentions, sound, MarkdownV2 toggle, etc.)WithHTTPClientto share an HTTP client across providers- Zero third-party deps; minimum Go version 1.22
Migration from v0.2.x
// v0.2.x
err := n.Send("subject", "content")
// v0.3.0
err := n.Send(ctx, notifier.Message{Subject: "subject", Content: "content"})
var multi *notifier.MultiError
if errors.As(err, &multi) {
for _, e := range multi.Errors {
log.Printf("%s: %v", e.Provider, e.Err)
}
}Also: ErrSendNotification → *MultiError; notifier.DefaultBarkServer → bark.DefaultServer; each provider/*.New(...) now takes a Config struct (top-level WithXxx helpers unchanged).
Security
- Webhook tokens embedded in URLs are stripped from
*url.Errorso they no longer leak via error messages or logs - Telegram MarkdownV2 Subject/Content auto-escaped, fixing parse errors on
.,_,-, etc.
Full Changelog: v0.2.0...v0.3.0
notifier-v0.2.0
- Upgrade Go version to 1.20
- Fix error handler in providers
- Refactor separate Options related methods into a standalone file
Full Changelog: v0.1.1...v0.2.0
notifier-v0.1.1
notifier-v0.1.0
Support these providers
| Provider | Code |
|---|---|
| DingTalk | provider/dingtalk |
| Bark | provider/bark |
| Lark | provider/lark |
| Feishu | provider/feishu |