app

package
v0.0.0-...-b6ebf10 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotHandler

type BotHandler func(tgbotapi.Update, Params) error

type BotRouter

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

func NewBotRouter

func NewBotRouter(srv *Service) *BotRouter

func (*BotRouter) Handle

func (r *BotRouter) Handle(query string, update tgbotapi.Update) error

type Config

type Config struct {
	FoodApi ServiceUrl
}

type DefaultParser

type DefaultParser struct {
}

func (DefaultParser) IsCommand

func (p DefaultParser) IsCommand(chunk string) bool

func (DefaultParser) IsFlag

func (p DefaultParser) IsFlag(chunk string) bool

func (*DefaultParser) Parse

func (p *DefaultParser) Parse(query string) Params

type Params

type Params struct {
	Path   string
	Params []string
}

func (Params) GetInt

func (p Params) GetInt(index int) (int, error)

func (Params) GetString

func (p Params) GetString(index int) (string, error)

func (Params) TouchParam

func (p Params) TouchParam(index int) error

type QueryParser

type QueryParser interface {
	Parse(query string) Params
}

type Service

type Service struct {
	Ingridients ingridients.Functionality

	Errors e.Factory
	Bot    *tgbotapi.BotAPI
	Router *BotRouter
}

func (*Service) AllIngridients

func (s *Service) AllIngridients(update tgbotapi.Update, params Params) error

func (*Service) FindIngridient

func (s *Service) FindIngridient(update tgbotapi.Update, params Params) error

func (*Service) RandomIngridient

func (s *Service) RandomIngridient(update tgbotapi.Update, params Params) error

func (*Service) SendErrorMessage

func (s *Service) SendErrorMessage(update tgbotapi.Update, err error)

type ServiceUrl

type ServiceUrl struct {
	Host string
	Port string
}

Jump to

Keyboard shortcuts

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