notify

package
v0.19.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package notify provides concrete notification delivery adapters (currently Telegram). Channels are configured at runtime via the settings store — no environment variables or restarts needed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TelegramConfig

type TelegramConfig struct {
	BotToken string `json:"bot_token"`
	ChatID   string `json:"chat_id"`
	Enabled  bool   `json:"enabled"`
}

TelegramConfig holds the Telegram bot configuration.

type TelegramSender

type TelegramSender struct {
	// contains filtered or unexported fields
}

TelegramSender sends notifications to a Telegram chat.

func NewTelegramSender

func NewTelegramSender(configFn func() *TelegramConfig) *TelegramSender

NewTelegramSender creates a Telegram sender. The configFn is called on each send to get the latest config from the settings store — this means config changes take effect immediately without restart.

func (*TelegramSender) Send

func (t *TelegramSender) Send(ctx context.Context, message string) error

Send sends a formatted message to the configured Telegram chat. Returns nil if Telegram is not configured or disabled.

func (*TelegramSender) SendTest

func (t *TelegramSender) SendTest(ctx context.Context) error

SendTest sends a test message to verify the configuration works.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL