handlers

package
v0.0.0-...-ab5ebe4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 10 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) GetKeyboardCategories

func (c *Helper) GetKeyboardCategories(
	categories []core.Category,
	callable func(category core.Category) []string,
) tgbotapi.InlineKeyboardMarkup

func (*Helper) GetKeyboardNotes

func (c *Helper) GetKeyboardNotes(
	notes []core.Note,
	callable func(note core.Note) []string,
) tgbotapi.InlineKeyboardMarkup

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 {
	GetKeyboardCategories(
		categories []core.Category,
		callable func(category core.Category) []string,
	) tgbotapi.InlineKeyboardMarkup
	GetKeyboardNotes(
		notes []core.Note,
		callable func(note core.Note) []string,
	) tgbotapi.InlineKeyboardMarkup
	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