telegram

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SourceType = "telegram"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BotToken string `yaml:"botToken"`
	ChatID   string `yaml:"chatId"`
	ThreadID int64  `yaml:"threadId,omitempty"`
}

func (*Config) Validate

func (c *Config) Validate() error

type Metrics

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

func GetMetricsInstance

func GetMetricsInstance(namespace, monitor string) *Metrics

func (Metrics) IncErrors

func (m Metrics) IncErrors(group, source, sourceType, errorType string)

func (Metrics) IncMessagesPublished

func (m Metrics) IncMessagesPublished(group, source, sourceType string)

type Telegram

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

func NewTelegram

func NewTelegram(ctx context.Context, log logrus.FieldLogger, monitor, name string, docs *string, includeMonitorName, includeGroupName bool, config *Config) (*Telegram, error)

func NewTelegramWithClient

func NewTelegramWithClient(log logrus.FieldLogger, monitor, name string, docs *string, includeMonitorName, includeGroupName bool, config *Config, client botClient) (*Telegram, error)

func (*Telegram) GetConfig

func (t *Telegram) GetConfig() *Config

func (*Telegram) GetName

func (t *Telegram) GetName() string

func (*Telegram) GetType

func (t *Telegram) GetType() string

func (*Telegram) Publish

func (t *Telegram) Publish(ctx context.Context, e event.Event) error

func (*Telegram) Start

func (t *Telegram) Start(ctx context.Context) error

func (*Telegram) Stop

func (t *Telegram) Stop(ctx context.Context) error

func (*Telegram) WithClient

func (t *Telegram) WithClient(client botClient) *Telegram

Jump to

Keyboard shortcuts

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