Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Bot runs the alertmanager telegram
func (*Bot) SendAdminMessage ¶
SendAdminMessage to the admin's ID with a message
type BotChatStore ¶
type BotChatStore interface { List() ([]telebot.Chat, error) Add(telebot.Chat) error Remove(telebot.Chat) error }
BotChatStore is all the Bot needs to store and read
type BotOption ¶
type BotOption func(b *Bot)
BotOption passed to NewBot to change the default instance
func WithAddr ¶
WithAddr sets the internal listening addr of the bot's web server receiving webhooks
func WithAlertmanager ¶
WithAlertmanager sets the connection url for the Alertmanager
func WithExtraAdmins ¶
WithExtraAdmins allows the specified additional user IDs to issue admin commands to the bot.
func WithLogger ¶
WithLogger sets the logger for the Bot as an option
func WithRevision ¶
WithRevision is setting the Bot's revision for status commands
func WithStartTime ¶
WithStartTime is setting the Bot's start time for status commands
func WithTemplates ¶
WithTemplates uses Alertmanager template to render messages for Telegram
type ChatStore ¶
type ChatStore struct {
// contains filtered or unexported fields
}
ChatStore writes the users to a libkv store backend
func NewChatStore ¶
NewChatStore stores telegram chats in the provided kv backend
type Data ¶
type Data struct { Receiver string `json:"receiver"` Status string `json:"status"` Alerts template.Alerts `json:"alerts"` GroupLabels template.KV `json:"groupLabels"` CommonLabels template.KV `json:"commonLabels"` CommonAnnotations template.KV `json:"commonAnnotations"` Data template.KV `json:"data"` ExternalURL string `json:"externalURL"` }