handlers

package
v0.0.0-...-d73c5c4 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHandlerParamsWithMocks

func GetHandlerParamsWithMocks(t *testing.T) (HandlerParams, *MockBag)

Types

type HandlerParams

type HandlerParams struct {
	Ctx      context.Context
	Services *services.Services
	Logger   services.Logger

	Messages config.Messages

	Helper TelegramHandlerHelper
}

type Helper

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

func NewHelper

func NewHelper(bot *tgbotapi.BotAPI) *Helper

func (*Helper) GetUpdatesChan

func (c *Helper) GetUpdatesChan(config tgbotapi.UpdateConfig) (tgbotapi.UpdatesChannel, error)

func (*Helper) NewMessage

func (c *Helper) NewMessage(chatID int64, text string) tgbotapi.MessageConfig

func (*Helper) NewUpdateChannel

func (c *Helper) NewUpdateChannel(offset int) tgbotapi.UpdateConfig

func (*Helper) SendMessage

func (c *Helper) SendMessage(msg tgbotapi.MessageConfig) error

type TelegramHandlerHelper

type TelegramHandlerHelper interface {
	NewMessage(chatID int64, text string) tgbotapi.MessageConfig
	SendMessage(msg tgbotapi.MessageConfig) error
	NewUpdateChannel(offset int) tgbotapi.UpdateConfig
	GetUpdatesChan(config tgbotapi.UpdateConfig) (tgbotapi.UpdatesChannel, error)
}

Directories

Path Synopsis
Package mock_handlers is a generated GoMock package.
Package mock_handlers is a generated GoMock package.

Jump to

Keyboard shortcuts

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