dispatch

package
v0.0.0-...-c756ae2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotCmd               = errors.New("not a command")
	ErrCmdNotSupported      = errors.New("command not supported")
	ErrCallbackNotSupported = errors.New("callback not supported")
	ErrInputNotSupported    = errors.New("user input type not supported")
)

Functions

This section is empty.

Types

type CallbackProcessor

type CallbackProcessor interface {
	Process(
		query *tgbotapi.CallbackQuery,
		args []string,
	) (*tgbotapi.CallbackConfig, *tgbotapi.MessageConfig)
}

type Cmd

type Cmd string
const (
	Alarms Cmd = "alarms"
	Alarm  Cmd = "alarm"

	Alarmdel Cmd = "alarmdel"
)

type CmdProcessor

type CmdProcessor interface {
	Process(msg *tgbotapi.Message) *tgbotapi.MessageConfig
}

type Dispatcher

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

func NewDispatcher

func NewDispatcher(db *db.Svc) *Dispatcher

func (*Dispatcher) ProcessCallback

func (*Dispatcher) ProcessCmd

func (d *Dispatcher) ProcessCmd(
	msg *tgbotapi.Message,
) (*tgbotapi.MessageConfig, error)

func (*Dispatcher) ProcessInput

func (d *Dispatcher) ProcessInput(
	msg *tgbotapi.Message,
) (*tgbotapi.MessageConfig, error)

type InputProcessor

type InputProcessor interface {
	Process(msg *tgbotapi.Message) *tgbotapi.MessageConfig
}

type InputType

type InputType string
const (
	DailyScheduleMsg InputType = "DailyScheduleMsg"
)

Jump to

Keyboard shortcuts

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