Documentation ¶
Index ¶
- func ParseButtonQuery(query string) (string, int, int64, error)
- type Application
- type HafasService
- type TelegramService
- func (t *TelegramService) AlarmMenu(ctx telegramconversation.TContext) telegramconversation.TContext
- func (t *TelegramService) Cancel(ctx telegramconversation.TContext) telegramconversation.TContext
- func (t *TelegramService) DeleteAlarm(ctx telegramconversation.TContext) telegramconversation.TContext
- func (t *TelegramService) EditDelay(ctx telegramconversation.TContext) telegramconversation.TContext
- func (t *TelegramService) ListTrainAlarms(ctx telegramconversation.TContext) telegramconversation.TContext
- func (t *TelegramService) NewAlarm(ctx telegramconversation.TContext) telegramconversation.TContext
- func (t *TelegramService) NewAlarmSelect(ctx telegramconversation.TContext) telegramconversation.TContext
- func (t *TelegramService) SaveAlarm(ctx telegramconversation.TContext) telegramconversation.TContext
- func (t *TelegramService) SaveDelay(ctx telegramconversation.TContext) telegramconversation.TContext
- func (t *TelegramService) Start(ctx telegramconversation.TContext) telegramconversation.TContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Application ¶
type Application interface { DeleteTrainAlarm(ctx context.Context, cmd application.DeleteTrainAlarmCmd) (*trainalarm.TrainAlarm, error) AddTrainAlarm(ctx context.Context, cmd application.AddTrainAlarmCmd) error UpdateTrainAlarmThreshold(ctx context.Context, cmd application.UpdateTrainAlarmThresholdCmd) error }
Application with business logic
type HafasService ¶
type HafasService interface {
FindTrain(ctx context.Context, trainName string, date time.Time) (*[]marudor.HafasTrainResult, error)
}
HafasService to request train informations
type TelegramService ¶
type TelegramService struct {
// contains filtered or unexported fields
}
TelegramService to handle requests
func NewTelegramService ¶
func NewTelegramService(log *logrus.Entry, repository trainalarm.Repository, application Application, hafas HafasService) *TelegramService
NewTelegramService to create a new service
func (*TelegramService) AlarmMenu ¶
func (t *TelegramService) AlarmMenu(ctx telegramconversation.TContext) telegramconversation.TContext
AlarmMenu to select alarm options
func (*TelegramService) Cancel ¶
func (t *TelegramService) Cancel(ctx telegramconversation.TContext) telegramconversation.TContext
Cancel conversation state
func (*TelegramService) DeleteAlarm ¶
func (t *TelegramService) DeleteAlarm(ctx telegramconversation.TContext) telegramconversation.TContext
DeleteAlarm from database
func (*TelegramService) EditDelay ¶
func (t *TelegramService) EditDelay(ctx telegramconversation.TContext) telegramconversation.TContext
EditDelay request train alarm threshold
func (*TelegramService) ListTrainAlarms ¶
func (t *TelegramService) ListTrainAlarms(ctx telegramconversation.TContext) telegramconversation.TContext
ListTrainAlarms command show current listalarmsings
func (*TelegramService) NewAlarm ¶
func (t *TelegramService) NewAlarm(ctx telegramconversation.TContext) telegramconversation.TContext
NewAlarm request train name
func (*TelegramService) NewAlarmSelect ¶
func (t *TelegramService) NewAlarmSelect(ctx telegramconversation.TContext) telegramconversation.TContext
NewAlarmSelect parse user input and show buttons to select a train
func (*TelegramService) SaveAlarm ¶
func (t *TelegramService) SaveAlarm(ctx telegramconversation.TContext) telegramconversation.TContext
SaveAlarm to database
func (*TelegramService) SaveDelay ¶
func (t *TelegramService) SaveDelay(ctx telegramconversation.TContext) telegramconversation.TContext
SaveDelay to database
func (*TelegramService) Start ¶
func (t *TelegramService) Start(ctx telegramconversation.TContext) telegramconversation.TContext
Start new conversation and/or print help
Click to show internal directories.
Click to hide internal directories.