Documentation ¶
Index ¶
- Variables
- func ParamsFromContext(ctx context.Context) denco.Params
- type FallbackRouter
- type Option
- type Path
- type Router
- func (r *Router) Configure() error
- func (r *Router) Handler(path string, handler http.Handler, methods ...string)
- func (r *Router) HandlerFunc(path string, handlerFunc http.HandlerFunc, methods ...string)
- func (r *Router) Options(options ...Option)
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type FallbackRouter ¶
type FallbackRouter struct {
// contains filtered or unexported fields
}
FallbackRouter is used to regist fallback handlers.
func NewFallbackRouter ¶
func NewFallbackRouter() *FallbackRouter
NewFallbackRouter creates a FallbackRouter.
func (*FallbackRouter) Configure ¶
func (r *FallbackRouter) Configure() error
Configure construct router.
func (*FallbackRouter) Handler ¶
func (r *FallbackRouter) Handler(path string, handler jimu.FallbackHandler)
Handler add a FallbackHandler to the router.
func (*FallbackRouter) Serve ¶
func (r *FallbackRouter) Serve(w http.ResponseWriter, req *http.Request, msg string, status int)
Serve implement FallbackHandler.
type Option ¶
Option for configuring Router.
func FallbackHandler ¶
func FallbackHandler(fallbackHandler jimu.FallbackHandler) Option
FallbackHandler set the fallback handler (for 404 ...) for the router.
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
func (*Path) Build ¶
Build concrete path from params. Param can be string, denco.Param or any fmt.Sprint-able object.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router is a wrapper around denco's router.
func (*Router) HandlerFunc ¶
func (r *Router) HandlerFunc(path string, handlerFunc http.HandlerFunc, methods ...string)
HandlerFunc add an http handler func to the router.
Click to show internal directories.
Click to hide internal directories.