Documentation ¶
Index ¶
- Constants
- func LocationToHTMLString(loc *entity.Location) string
- func ResetAwaitInput(resetInput ResetInputType, chatID int64, s storage.Service) error
- func ShowCreateSubscription(chatID int64, bot *tgbotapi.BotAPI)
- func ShowHome(bot *tgbotapi.BotAPI, chatID int64)
- func ShowSetDelay(chatID int64, subID string, bot *tgbotapi.BotAPI, s storage.Service)
- func ShowSetLocation(chatID int64, subID string, bot *tgbotapi.BotAPI, s storage.Service)
- func ShowSetMagnitude(chatID int64, subID string, bot *tgbotapi.BotAPI, s storage.Service)
- func ShowSetName(chatID int64, subID string, bot *tgbotapi.BotAPI, s storage.Service)
- func ShowSetRadius(chatID int64, subID string, bot *tgbotapi.BotAPI, s storage.Service)
- func ShowSubscription(chatID int64, subID string, bot *tgbotapi.BotAPI, s storage.Service)
- func ShowSubscriptions(chatID int64, bot *tgbotapi.BotAPI, s storage.Service)
- func ShowUnknownCommand(bot *tgbotapi.BotAPI, chatID int64)
- func UnknownCommandText() string
- type Action
- type Actionable
- type Cmd
- type CreateSubscriptionAction
- type DeleteSubscriptionAction
- type DisableInputAction
- type HomeAction
- type ListSourcesAction
- type Params
- type ResetInputType
- type SetDelayAction
- type SetLocationAction
- type SetMagnitudeAction
- type SetNameAction
- type SetRadiusAction
- type SetSourceAction
- type SettingsAction
- type Source
- type SubscriptionAction
- type SubscriptionsAction
Constants ¶
View Source
const ConfirmDeleteSub = "+"
View Source
const ToggleDisableInput = "+"
View Source
const ToggleSetSource = "+"
Variables ¶
This section is empty.
Functions ¶
func LocationToHTMLString ¶
func ResetAwaitInput ¶
func ResetAwaitInput(resetInput ResetInputType, chatID int64, s storage.Service) error
func ShowCreateSubscription ¶
func ShowSetDelay ¶
func ShowSetLocation ¶
func ShowSetMagnitude ¶
func ShowSetName ¶
func ShowSetRadius ¶
func ShowSubscription ¶
func ShowSubscriptions ¶
func ShowUnknownCommand ¶
func UnknownCommandText ¶
func UnknownCommandText() string
Types ¶
type Action ¶
func (Action) ProcessUserInput ¶
type Actionable ¶
type Actionable interface { Perform(bot *tgbotapi.BotAPI, msg *tgbotapi.Message, s storage.Service) ProcessUserInput(bot *tgbotapi.BotAPI, update *tgbotapi.Update, s storage.Service) }
func Decode ¶
func Decode(data string) (Actionable, error)
func New ¶
func New(data string) (Actionable, error)
type Cmd ¶
type Cmd string
const CreateSub Cmd = "CREATE_SUB"
const DeleteSub Cmd = "DELETE_SUB"
const DisableInput Cmd = "DISABLE_INPUT"
const Home Cmd = "HOME"
const ListSources Cmd = "LIST_SRCS"
const SetDelay Cmd = "SET_DELAY"
const SetLocation Cmd = "SET_LOCATION"
const SetMagnitude Cmd = "SET_MAG"
const SetName Cmd = "SET_NAME"
const SetRadius Cmd = "SET_RADIUS"
const SetSource Cmd = "SET_SOURCE"
const Settings Cmd = "SETTINGS"
const Sub Cmd = "SUB"
const Subs Cmd = "SUBS"
type CreateSubscriptionAction ¶
type CreateSubscriptionAction struct {
Action
}
func NewCreateSubscriptionAction ¶
func NewCreateSubscriptionAction() CreateSubscriptionAction
func (CreateSubscriptionAction) ProcessUserInput ¶
func (CreateSubscriptionAction) WrongInput ¶
func (a CreateSubscriptionAction) WrongInput() string
type DeleteSubscriptionAction ¶
type DeleteSubscriptionAction struct {
Action
}
func NewDeleteSubscriptionAction ¶
func NewDeleteSubscriptionAction(subID, confirm string) DeleteSubscriptionAction
type DisableInputAction ¶
type DisableInputAction struct {
Action
}
func NewDisableInputAction ¶
func NewDisableInputAction(confirm string) DisableInputAction
type HomeAction ¶
type HomeAction struct {
Action
}
func NewHomeAction ¶
func NewHomeAction() HomeAction
type ListSourcesAction ¶
type ListSourcesAction struct {
Action
}
func NewListSourcesAction ¶
func NewListSourcesAction(subID string) ListSourcesAction
type SetDelayAction ¶
type SetDelayAction struct {
Action
}
func NewSetDelayAction ¶
func NewSetDelayAction(subID string) SetDelayAction
func (SetDelayAction) ProcessUserInput ¶
func (SetDelayAction) WrongInput ¶
func (a SetDelayAction) WrongInput() string
type SetLocationAction ¶
type SetLocationAction struct {
Action
}
func NewSetLocationAction ¶
func NewSetLocationAction(subID string) SetLocationAction
func (SetLocationAction) ProcessUserInput ¶
func (SetLocationAction) WrongInput ¶
func (a SetLocationAction) WrongInput() string
type SetMagnitudeAction ¶
type SetMagnitudeAction struct {
Action
}
func NewSetMagnitudeAction ¶
func NewSetMagnitudeAction(subID string) SetMagnitudeAction
func (SetMagnitudeAction) ProcessUserInput ¶
func (SetMagnitudeAction) WrongInput ¶
func (a SetMagnitudeAction) WrongInput() string
type SetNameAction ¶
type SetNameAction struct {
Action
}
func NewSetNameAction ¶
func NewSetNameAction(subID string) SetNameAction
func (SetNameAction) ProcessUserInput ¶
func (SetNameAction) WrongInput ¶
func (a SetNameAction) WrongInput() string
type SetRadiusAction ¶
type SetRadiusAction struct {
Action
}
func NewSetRadiusAction ¶
func NewSetRadiusAction(subID string) SetRadiusAction
func (SetRadiusAction) ProcessUserInput ¶
func (SetRadiusAction) WrongInput ¶
func (a SetRadiusAction) WrongInput() string
type SetSourceAction ¶
type SetSourceAction struct {
Action
}
func NewSetSourceAction ¶
func NewSetSourceAction(subID, sourceID, confirm string) SetSourceAction
type SettingsAction ¶
type SettingsAction struct {
Action
}
func NewSettingsAction ¶
func NewSettingsAction(reset ResetInputType) SettingsAction
type SubscriptionAction ¶
type SubscriptionAction struct {
Action
}
func NewSubscriptionAction ¶
func NewSubscriptionAction(subID string, reset ResetInputType) SubscriptionAction
type SubscriptionsAction ¶
type SubscriptionsAction struct {
Action
}
func NewSubscriptionsAction ¶
func NewSubscriptionsAction(reset ResetInputType) SubscriptionsAction
Click to show internal directories.
Click to hide internal directories.