Skip to content

A lightweight Go toolkit for sending notifications via Telegram, Bark, and more.

Notifications You must be signed in to change notification settings

sudowanderer/notikit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

notikit

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.

✨ Features

  • πŸ”” 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)

πŸ“¦ Installation

go get github.com/sudowanderer/notikit

Or for local development:

replace github.com/sudowanderer/notikit => ../path/to/notikit

πŸš€ Usage Example

package 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)
	}
}

Set required environment variables

export BOT_TOKEN=xxx
export CHAT_ID=xxx
export BARK_URL=https://api.day.app/xxx

Run integration tests

go test -tags=integration ./notifier -v

About

A lightweight Go toolkit for sending notifications via Telegram, Bark, and more.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages