Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrComm will be used when the communication to telegram fails. ErrComm = errors.New("error communicating with telegram") )
Functions ¶
Types ¶
type Client ¶
Client is an small abstraction for the telegram-bot-api client. the client of this lib should satisfy directly. More info here: https://godoc.org/github.com/go-telegram-bot-api/telegram-bot-api.
type Config ¶
type Config struct {
// This is the ID of the channel or group where the alerts
// will be sent by default.
// Got from here https://github.com/GabrielRF/telegram-id#web-channel-id
// You ca get the the ID like this:
// - Enter the telegram web app and there to the channel/group.
// - Check the URL, it has this schema: https://web.telegram.org/#/im?p=c1234567891_12345678912345678912
// - Get the `c1234567891_`, get this part: `1234567891`.
// - Add `-100` (until you have 13 characters), this should be the chat ID: `-1001234567891`
DefaultTelegramChatID int64
// TemplateRenderer is the renderer that will be used to render the
// notifications before sending to Telegram.
TemplateRenderer notify.TemplateRenderer
// Client is the telegram client is compatible with "github.com/go-telegram-bot-api/telegram-bot-api"
// library client API.
Client Client
// Logger is the logger.
Logger log.Logger
}
Config is the configuration of the Notifier.
Click to show internal directories.
Click to hide internal directories.