Documentation
¶
Index ¶
- type AdminTelegramService
- type CallbackAnswerer
- type Handler
- func (h *Handler) GetBindingStatus(c *gin.Context)
- func (h *Handler) HandleWebhook(c *gin.Context)
- func (h *Handler) SetAdminService(adminService AdminTelegramService)
- func (h *Handler) SetCallbackAnswerer(answerer CallbackAnswerer)
- func (h *Handler) SetMuteService(muteService MuteNotificationService)
- func (h *Handler) SetWebhookSecretProvider(provider WebhookSecretProvider)
- func (h *Handler) Unbind(c *gin.Context)
- func (h *Handler) UpdatePreferences(c *gin.Context)
- type MuteNotificationService
- type WebhookSecretProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminTelegramService ¶ added in v0.1.52
type AdminTelegramService interface {
BindFromWebhook(ctx context.Context, verifyCode string, telegramUserID int64, telegramUsername string) (any, error)
UnbindByTelegramID(ctx context.Context, telegramUserID int64) error
GetBindingByTelegramID(ctx context.Context, telegramUserID int64) (any, error)
}
AdminTelegramService defines the interface for admin telegram binding
type CallbackAnswerer ¶ added in v0.1.52
type CallbackAnswerer interface {
AnswerCallbackQuery(callbackQueryID string, text string, showAlert bool) error
EditMessageWithInlineKeyboard(chatID int64, messageID int64, text string, keyboard any) error
EditMessageReplyMarkup(chatID int64, messageID int64, keyboard any) error
}
CallbackAnswerer defines the interface for answering Telegram callback queries
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles telegram-related HTTP requests
func NewHandler ¶
func NewHandler(service *telegramApp.ServiceDDD, logger logger.Interface, webhookSecret string) *Handler
NewHandler creates a new telegram handler
func (*Handler) GetBindingStatus ¶
GetBindingStatus returns the current telegram binding status GET /telegram/binding
func (*Handler) HandleWebhook ¶
HandleWebhook handles Telegram webhook updates POST /webhooks/telegram
func (*Handler) SetAdminService ¶ added in v0.1.52
func (h *Handler) SetAdminService(adminService AdminTelegramService)
SetAdminService sets the admin telegram service (optional dependency injection)
func (*Handler) SetCallbackAnswerer ¶ added in v0.1.52
func (h *Handler) SetCallbackAnswerer(answerer CallbackAnswerer)
SetCallbackAnswerer sets the callback answerer (optional dependency injection)
func (*Handler) SetMuteService ¶ added in v0.1.52
func (h *Handler) SetMuteService(muteService MuteNotificationService)
SetMuteService sets the mute notification service (optional dependency injection)
func (*Handler) SetWebhookSecretProvider ¶ added in v0.1.52
func (h *Handler) SetWebhookSecretProvider(provider WebhookSecretProvider)
SetWebhookSecretProvider sets the provider for hot-reloadable webhook secret
func (*Handler) UpdatePreferences ¶
UpdatePreferences updates notification preferences PATCH /telegram/preferences
type MuteNotificationService ¶ added in v0.1.52
type MuteNotificationService interface {
MuteAgentNotification(ctx context.Context, agentSID string) error
MuteNodeNotification(ctx context.Context, nodeSID string) error
UnmuteAgentNotification(ctx context.Context, agentSID string) error
UnmuteNodeNotification(ctx context.Context, nodeSID string) error
}
MuteNotificationService defines the interface for muting resource notifications
type WebhookSecretProvider ¶ added in v0.1.52
WebhookSecretProvider provides webhook secret with hot-reload support