notikit is a lightweight Go notification toolkit that allows you to send messages across multiple channels, including Telegram and Bark. It's designed to be easy to extend and integrate into any backend application or service.
- π Send notifications via multiple channels
- π¬ Built-in support for:
- Telegram Bot Notification
- Bark (iOS Push Notification)
- π§± Modular and easy to extend
- π§ͺ Supports integration testing
- π Timestamp with timezone support (for Telegram)
go get github.com/sudowanderer/notikit
Or for local development:
replace github.com/sudowanderer/notikit => ../path/to/notikitpackage main
import (
"log"
"os"
"time"
"github.com/sudowanderer/notikit/notifier"
)
func main() {
// Optional timezone for Telegram messages
loc, _ := time.LoadLocation("Asia/Shanghai")
// Telegram Notifier
tg := notifier.NewTelegramNotifierWithLocation(
os.Getenv("BOT_TOKEN"),
os.Getenv("CHAT_ID"),
loc,
)
// Bark Notifier
bark := notifier.NewBarkNotifier(os.Getenv("BARK_URL"))
// Combine all channels
multi := notifier.NewMultiNotifier(tg, bark)
// Send message to all channels
err := multi.Notify("π Deployment completed successfully")
if err != nil {
log.Fatal(err)
}
}export BOT_TOKEN=xxx
export CHAT_ID=xxx
export BARK_URL=https://api.day.app/xxxgo test -tags=integration ./notifier -v