app

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 13 Imported by: 1

Documentation

Overview

Package app is mostly needed to get rid of the import cycle that would take place if this code resides in the 'base' package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleUpdate

func HandleUpdate(appParams *Params, wg *sync.WaitGroup, upd *tgbotapi.Update)

HandleUpdate is the main router function for processing of tgbotapi.Update.

func NewAppEnv

func NewAppEnv(params *Params) *base.ApplicationEnv

NewAppEnv is a constructor for base.ApplicationEnv. They reside in different packages to eliminate an import cycle.

Types

type Params

type Params struct {
	Ctx              context.Context
	MessageHandlers  []base.MessageHandler
	InlineHandlers   []base.InlineHandler
	CallbackHandlers []base.CallbackHandler
	Settings         settings.OptionsFetcher
	LangPool         *loc.Pool
	API              *base.BotAPI
	StateStorage     wizard.StateStorage
	DB               *pgxpool.Pool
}

Params is a huge container will all possible resources of the application. It should be used in the main function, app and server packages only!

Jump to

Keyboard shortcuts

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