Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultNotFoundHandler ¶
func DefaultNotFoundHandler(_ context.Context, msg telegram_bot.Update) (telegram_bot.Chattable, error)
func NotFoundHandlerWithMessage ¶
func NotFoundHandlerWithMessage(_ context.Context, msg telegram_bot.Update) (telegram_bot.Chattable, error)
Types ¶
type BotError ¶
type BotError interface {
BotResponse(chatId int64) telegram_bot.Chattable
}
type HandlerFunc ¶
type HandlerFunc func(ctx context.Context, msg telegram_bot.Update) (telegram_bot.Chattable, error)
type Middleware ¶
type Middleware func(next HandlerFunc) HandlerFunc
func DefaultMiddlewares ¶
func DefaultMiddlewares(logger log.Logger) []Middleware
func ErrorHandler ¶
func ErrorHandler(logger log.Logger) Middleware
func Log ¶
func Log(logger log.Logger) Middleware
func Recovery ¶
func Recovery() Middleware
func RequestId ¶
func RequestId() Middleware
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func NewRouter ¶
func NewRouter(middlewares ...Middleware) *Router
func (*Router) Handle ¶
func (r *Router) Handle(ctx context.Context, msg telegram_bot.Update) (telegram_bot.Chattable, error)
func (*Router) Handler ¶
func (r *Router) Handler(updateType string, command string, handler HandlerFunc)
func (*Router) SetNotFoundHandler ¶
func (r *Router) SetNotFoundHandler(notFoundHandler HandlerFunc)
Click to show internal directories.
Click to hide internal directories.