Documentation
¶
Index ¶
- Variables
- type Context
- type ErrorHandler
- type HandlerFunc
- type Middleware
- type Option
- type RouteHandler
- type Router
- func (r *Router) Group(fn func(sub *Router))
- func (r *Router) Handle(upd schemes.UpdateInterface, ctx context.Context)
- func (r *Router) HandleCallback(payload string, f HandlerFunc)
- func (r *Router) HandleCommand(cmd string, f HandlerFunc)
- func (r *Router) HandleCtx(ctx context.Context, upd schemes.UpdateInterface) error
- func (r *Router) HandleRegexpCallback(re *regexp.Regexp, f HandlerFunc)
- func (r *Router) HandleRegexpText(re *regexp.Regexp, f HandlerFunc)
- func (r *Router) HandleStart(f HandlerFunc)
- func (r *Router) HandleText(text string, f HandlerFunc)
- func (r *Router) HandleType(t schemes.UpdateType, f HandlerFunc)
- func (r *Router) NotFound(f HandlerFunc)
- func (r *Router) OnError(eh ErrorHandler)
- func (r *Router) Use(mws ...Middleware)
- func (r *Router) With(mws ...Middleware) *Router
- type RouterOption
- type SendOptions
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface {
Update() schemes.UpdateInterface
API() *maxbot.Api
Ctx() context.Context
Message() *schemes.Message
Callback() *schemes.Callback
Text() string
Command() string
Data() string
ChatID() int64
UserID() int64
Set(key string, val any)
Get(key string) (any, bool)
Send(text string, opts ...Option) error
Reply(text string, opts ...Option) error
Edit(text string, opts ...Option) error
Answer(notification string) error
User() *schemes.User
FullName() string
Username() string
FirstName() string
LastName() string
Handled() bool
}
type ErrorHandler ¶
type HandlerFunc ¶
func (HandlerFunc) ServeContext ¶
func (f HandlerFunc) ServeContext(ctx Context) error
type Middleware ¶
type Middleware func(next RouteHandler) RouteHandler
type Option ¶
type Option func(*SendOptions)
func WithAttachments ¶
func WithFormat ¶
func WithKeyboard ¶
func WithNotify ¶
func WithReplyTo ¶
type RouteHandler ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) HandleCallback ¶
func (r *Router) HandleCallback(payload string, f HandlerFunc)
func (*Router) HandleCommand ¶
func (r *Router) HandleCommand(cmd string, f HandlerFunc)
func (*Router) HandleRegexpCallback ¶
func (r *Router) HandleRegexpCallback(re *regexp.Regexp, f HandlerFunc)
func (*Router) HandleRegexpText ¶
func (r *Router) HandleRegexpText(re *regexp.Regexp, f HandlerFunc)
func (*Router) HandleStart ¶
func (r *Router) HandleStart(f HandlerFunc)
func (*Router) HandleText ¶
func (r *Router) HandleText(text string, f HandlerFunc)
func (*Router) HandleType ¶
func (r *Router) HandleType(t schemes.UpdateType, f HandlerFunc)
func (*Router) NotFound ¶
func (r *Router) NotFound(f HandlerFunc)
func (*Router) OnError ¶
func (r *Router) OnError(eh ErrorHandler)
func (*Router) Use ¶
func (r *Router) Use(mws ...Middleware)
func (*Router) With ¶
func (r *Router) With(mws ...Middleware) *Router
type RouterOption ¶
type RouterOption func(*Router)
func WithAsync ¶
func WithAsync(async bool) RouterOption
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
