Documentation ¶
Index ¶
- func As(name string)
- func AsDefault()
- type Response
- type Router
- func (r *Router) CONNECT(path string, handler interface{}) error
- func (r *Router) DELETE(path string, handler interface{}) error
- func (r *Router) GET(path string, handler interface{}) error
- func (r *Router) HEAD(path string, handler interface{}) error
- func (r *Router) ListenAndServe(address string) error
- func (r *Router) OPTIONS(path string, handler interface{}) error
- func (r *Router) PATCH(path string, handler interface{}) error
- func (r *Router) POST(path string, handler interface{}) error
- func (r *Router) PUT(path string, handler interface{}) error
- func (r *Router) Shutdown() error
- func (r *Router) TRACE(path string, handler interface{}) error
- func (r *Router) WithErrorHandler(handler interface{}) error
- func (r *Router) WithGroup(path string, callback func(group router.Group)) error
- func (r *Router) WithMethodNotAllowedHandler(handler interface{}) error
- func (r *Router) WithMiddleware(handler interface{}) error
- func (r *Router) WithNotFoundHandler(handler interface{}) error
- func (r *Router) WithRoute(method string, path string, handler interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func NewResponse(ctx *fasthttp.RequestCtx) *Response
func (*Response) WriteHeader ¶
type Router ¶
type Router struct { Middleware []interface{} Routes structures.Table[string, string, router.Handler] *fhttp.Server *fhttpRouter.Router ErrorHandler router.Handler }
Router is a router implementation based on fasthttp
func NewRouter ¶
func NewRouter() *Router
NewRouter will create new instance of the mojito fasthttp router implementation
func (*Router) ListenAndServe ¶
ListenAndServe will start an HTTP webserver on the given address
func (*Router) WithErrorHandler ¶
WithErrorHandler will set the error handler for the router
func (*Router) WithMethodNotAllowedHandler ¶
WithMethodNotAllowedHandler will set the not allowed handler for the router
func (*Router) WithMiddleware ¶
WithMiddleware will add a middleware to the router
func (*Router) WithNotFoundHandler ¶
WithNotFoundHandler will set the not found handler for the router
Click to show internal directories.
Click to hide internal directories.