handlers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldAlias     = "alias"
	FieldObject    = "object"
	FieldDeleteAll = "deleteAll"
	FieldLanguage  = "language"

	StatusSuccess   = "success"
	StatusFailure   = "failure"
	StatusNoRows    = "no.rows"
	StatusDuplicate = "duplicate"

	FieldValidationErrorTrInfix = ".validation.error."
	FieldMaxLengthErrorTrSuffix = FieldValidationErrorTrInfix + "length"

	DuplicateConstraintSQLCode = "23505"
)
View Source
const (
	DeleteFieldsTrPrefix = "commands.delete.fields."
	DeleteStatusTrPrefix = "commands.delete.status."
	DeleteStatusSuccess  = DeleteStatusTrPrefix + StatusSuccess
	DeleteStatusFailure  = DeleteStatusTrPrefix + StatusFailure
	DeleteStatusNoRows   = DeleteStatusTrPrefix + StatusNoRows
	Yes                  = "👍"
	No                   = "👎"
	SelectObjectBtnTr    = "commands.delete.button.select.object"
)
View Source
const (
	ErrorTitleTr  = "error"
	UnknownTypeTr = "inline.errors.type.invalid"
)
View Source
const (
	InstallFieldsTrPrefix       = "commands.install.fields."
	InstallStatusTrPrefix       = "commands.install.status."
	InstallStatusSuccess        = InstallStatusTrPrefix + StatusSuccess
	InstallStatusSuccessNoNames = InstallStatusTrPrefix + StatusSuccess + ".no.names"
	InstallStatusFailure        = InstallStatusTrPrefix + StatusFailure
	InstallStatusNoRows         = InstallStatusTrPrefix + StatusNoRows
	PackageItems                = "commands.install.message.package.favs"

	FieldConfirmation = "confirmation"
)
View Source
const (
	LangParamPrompt       = "commands.language.fields.language"
	LanguageStatusFailure = "commands.language.status.failure"

	EnCode = "en"
	EnFlag = "🇺🇸"
	RuCode = "ru"
	RuFlag = "🇷🇺"
)
View Source
const (
	LinkFieldTrPrefix                     = "commands.link.fields."
	LinkStatusTrPrefix                    = "commands.link.status."
	LinkStatusSuccess                     = LinkStatusTrPrefix + StatusSuccess
	LinkStatusFailure                     = LinkStatusTrPrefix + StatusFailure
	LinkStatusDuplicate                   = LinkStatusTrPrefix + StatusDuplicate
	LinkStatusDuplicateFav                = LinkStatusTrPrefix + StatusDuplicate + ".fav"
	LinkStatusNoAlias                     = LinkStatusTrPrefix + "no.alias"
	LinkStatusErrorForbiddenSymbolsInName = LinkFieldTrPrefix + FieldName + FieldValidationErrorTrInfix + "forbidden.symbols"
)
View Source
const (
	ListStatusTrPrefix                 = "commands.list.status."
	ListStatusSuccessFavs              = ListStatusTrPrefix + StatusSuccess + ".favs"
	ListStatusSuccessPackages          = ListStatusTrPrefix + StatusSuccess + ".packages"
	ListStatusFailure                  = ListStatusTrPrefix + StatusFailure
	ListStatusNoRowsFavs               = ListStatusTrPrefix + StatusNoRows + ".favs"
	ListStatusNoRowsPackages           = ListStatusTrPrefix + StatusNoRows + ".packages"
	ListFieldAliasesOrPackagesPromptTr = "commands.list.fields.favs.or.packages"

	FieldFavsOrPackages = "favsOrPackages"
	Favs                = "Favs"
	Packages            = "Packages"

	LinePrefix = "• "
)
View Source
const (
	ModeFieldsTrPrefix = "commands.mode.fields."
	ModeStatusTrPrefix = "commands.mode.status."
	ModeStatusSuccess  = ModeStatusTrPrefix + StatusSuccess
	ModeStatusFailure  = ModeStatusTrPrefix + StatusFailure

	ModeMessageCurrentVal = "commands.mode.message.current.value"
	Enabled               = "✅"
	Disabled              = "🚫"

	FieldSubstrSearchEnabled = "substringSearchEnabled"
)
View Source
const (
	PackageFieldsTrPrefix        = "commands.package.fields."
	PackageStatusTrPrefix        = "commands.package.status."
	PackageStatusCreationSuccess = PackageStatusTrPrefix + StatusSuccess + ".creation"
	PackageStatusDeletionSuccess = PackageStatusTrPrefix + StatusSuccess + ".deletion"
	PackageStatusFailure         = PackageStatusTrPrefix + StatusFailure
	PackageStatusDuplicate       = PackageStatusTrPrefix + StatusDuplicate
	PackageStatusNoRows          = PackageStatusTrPrefix + StatusNoRows

	PackageStatusErrorForbiddenSymbolsInName = PackageFieldsTrPrefix + FieldName + FieldValidationErrorTrInfix + "forbidden.symbols"

	FieldCreateOrDelete = "createOrDelete"
	FieldName           = "name"
	FieldAliases        = FieldAlias + "es"

	Create = "Create"
	Delete = "Delete"

	MaxPackageNameLen = 256
)
View Source
const (
	SaveFieldsTrPrefix  = "commands.save.fields."
	SaveStatusTrPrefix  = "commands.save.status."
	SaveStatusSuccess   = SaveStatusTrPrefix + StatusSuccess
	SaveStatusFailure   = SaveStatusTrPrefix + StatusFailure
	SaveStatusDuplicate = SaveStatusTrPrefix + StatusDuplicate

	SaveStatusErrorForbiddenSymbolsInAlias = SaveFieldsTrPrefix + FieldAlias + FieldValidationErrorTrInfix + "forbidden.symbols"

	MaxAliasLen               = 128
	MaxTextLen                = 4096
	ReservedSymbols           = ReservedSymbolsForMessage + "\n"
	ReservedSymbolsForMessage = "•@|{}[]:"
)
View Source
const (
	StartStatusFailure     = "commands.start.status." + StatusFailure
	FieldInstallingPackage = "installingPackage"
)
View Source
const SuccessTr = "success"

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelHandler

type CancelHandler struct {
	StateStorage wizard.StateStorage
}

func (CancelHandler) CanHandle

func (CancelHandler) CanHandle(msg *tgbotapi.Message) bool

func (CancelHandler) Handle

func (c CancelHandler) Handle(reqenv *base.RequestEnv, msg *tgbotapi.Message)

type DeleteHandler

type DeleteHandler struct {
	StateStorage wizard.StateStorage
}

func (DeleteHandler) CanHandle

func (DeleteHandler) CanHandle(msg *tgbotapi.Message) bool

func (DeleteHandler) GetWizardDescriptor

func (handler DeleteHandler) GetWizardDescriptor() *wizard.FormDescriptor

func (DeleteHandler) GetWizardName

func (DeleteHandler) GetWizardName() string

func (DeleteHandler) GetWizardStateStorage

func (handler DeleteHandler) GetWizardStateStorage() wizard.StateStorage

func (DeleteHandler) Handle

func (handler DeleteHandler) Handle(reqenv *base.RequestEnv, msg *tgbotapi.Message)

type GetFavoritesInlineHandler

type GetFavoritesInlineHandler struct{}

func (GetFavoritesInlineHandler) CanHandle

func (GetFavoritesInlineHandler) Handle

type InstallPackageHandler added in v0.3.0

type InstallPackageHandler struct {
	StateStorage wizard.StateStorage
}

func (InstallPackageHandler) CanHandle added in v0.3.0

func (handler InstallPackageHandler) CanHandle(msg *tgbotapi.Message) bool

func (InstallPackageHandler) GetWizardDescriptor added in v0.3.0

func (handler InstallPackageHandler) GetWizardDescriptor() *wizard.FormDescriptor

func (InstallPackageHandler) GetWizardName added in v0.3.0

func (InstallPackageHandler) GetWizardName() string

func (InstallPackageHandler) GetWizardStateStorage added in v0.3.0

func (handler InstallPackageHandler) GetWizardStateStorage() wizard.StateStorage

func (InstallPackageHandler) Handle added in v0.3.0

func (handler InstallPackageHandler) Handle(reqenv *base.RequestEnv, msg *tgbotapi.Message)

type LanguageHandler

type LanguageHandler struct {
	StateStorage wizard.StateStorage
}

func (LanguageHandler) CanHandle

func (LanguageHandler) CanHandle(msg *tgbotapi.Message) bool

func (LanguageHandler) GetWizardDescriptor

func (LanguageHandler) GetWizardDescriptor() *wizard.FormDescriptor

func (LanguageHandler) GetWizardName

func (LanguageHandler) GetWizardName() string

func (LanguageHandler) GetWizardStateStorage

func (handler LanguageHandler) GetWizardStateStorage() wizard.StateStorage

func (LanguageHandler) Handle

func (handler LanguageHandler) Handle(reqenv *base.RequestEnv, msg *tgbotapi.Message)

type LinkHandler added in v0.3.2

type LinkHandler struct {
	StateStorage wizard.StateStorage
}

func (LinkHandler) CanHandle added in v0.3.2

func (handler LinkHandler) CanHandle(msg *tgbotapi.Message) bool

func (LinkHandler) GetWizardDescriptor added in v0.3.2

func (handler LinkHandler) GetWizardDescriptor() *wizard.FormDescriptor

func (LinkHandler) GetWizardName added in v0.3.2

func (LinkHandler) GetWizardName() string

func (LinkHandler) GetWizardStateStorage added in v0.3.2

func (handler LinkHandler) GetWizardStateStorage() wizard.StateStorage

func (LinkHandler) Handle added in v0.3.2

func (handler LinkHandler) Handle(reqenv *base.RequestEnv, msg *tgbotapi.Message)

type ListHandler added in v0.2.0

type ListHandler struct {
	StateStorage wizard.StateStorage
}

func (ListHandler) CanHandle added in v0.2.0

func (ListHandler) CanHandle(msg *tgbotapi.Message) bool

func (ListHandler) GetWizardDescriptor added in v0.3.0

func (handler ListHandler) GetWizardDescriptor() *wizard.FormDescriptor

func (ListHandler) GetWizardName added in v0.3.0

func (ListHandler) GetWizardName() string

func (ListHandler) GetWizardStateStorage added in v0.3.0

func (handler ListHandler) GetWizardStateStorage() wizard.StateStorage

func (ListHandler) Handle added in v0.2.0

func (handler ListHandler) Handle(reqenv *base.RequestEnv, msg *tgbotapi.Message)

type PackageHandler added in v0.3.0

type PackageHandler struct {
	StateStorage wizard.StateStorage
}

func (PackageHandler) CanHandle added in v0.3.0

func (PackageHandler) CanHandle(msg *tgbotapi.Message) bool

func (PackageHandler) GetWizardDescriptor added in v0.3.0

func (PackageHandler) GetWizardDescriptor() *wizard.FormDescriptor

func (PackageHandler) GetWizardName added in v0.3.0

func (PackageHandler) GetWizardName() string

func (PackageHandler) GetWizardStateStorage added in v0.3.0

func (handler PackageHandler) GetWizardStateStorage() wizard.StateStorage

func (PackageHandler) Handle added in v0.3.0

func (handler PackageHandler) Handle(reqenv *base.RequestEnv, msg *tgbotapi.Message)

type SaveHandler

type SaveHandler struct {
	StateStorage wizard.StateStorage
}

func (SaveHandler) CanHandle

func (SaveHandler) CanHandle(msg *tgbotapi.Message) bool

func (SaveHandler) GetWizardDescriptor

func (handler SaveHandler) GetWizardDescriptor() *wizard.FormDescriptor

func (SaveHandler) GetWizardName

func (SaveHandler) GetWizardName() string

func (SaveHandler) GetWizardStateStorage

func (handler SaveHandler) GetWizardStateStorage() wizard.StateStorage

func (SaveHandler) Handle

func (handler SaveHandler) Handle(reqenv *base.RequestEnv, msg *tgbotapi.Message)

type SearchModeHandler added in v0.3.3

type SearchModeHandler struct {
	StateStorage wizard.StateStorage
}

func (SearchModeHandler) CanHandle added in v0.3.3

func (SearchModeHandler) CanHandle(msg *tgbotapi.Message) bool

func (SearchModeHandler) GetWizardDescriptor added in v0.3.3

func (SearchModeHandler) GetWizardDescriptor() *wizard.FormDescriptor

func (SearchModeHandler) GetWizardName added in v0.3.3

func (SearchModeHandler) GetWizardName() string

func (SearchModeHandler) GetWizardStateStorage added in v0.3.3

func (handler SearchModeHandler) GetWizardStateStorage() wizard.StateStorage

func (SearchModeHandler) Handle added in v0.3.3

func (handler SearchModeHandler) Handle(reqenv *base.RequestEnv, msg *tgbotapi.Message)

type StartHandler

type StartHandler struct {
	StateStorage          wizard.StateStorage
	InstallPackageHandler *InstallPackageHandler
}

func (StartHandler) CanHandle

func (StartHandler) CanHandle(msg *tgbotapi.Message) bool

func (StartHandler) GetWizardDescriptor

func (handler StartHandler) GetWizardDescriptor() *wizard.FormDescriptor

func (StartHandler) GetWizardName

func (StartHandler) GetWizardName() string

func (StartHandler) GetWizardStateStorage

func (handler StartHandler) GetWizardStateStorage() wizard.StateStorage

func (StartHandler) Handle

func (handler StartHandler) Handle(reqenv *base.RequestEnv, msg *tgbotapi.Message)

type StoredObject

type StoredObject struct {
	ID     string
	Type   wizard.FieldType
	FileID *string
	Text   *string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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