Documentation ¶
Index ¶
- func WrapF(f http.HandlerFunc) httprouter.Handle
- func WrapH(h http.Handler) httprouter.Handle
- type Middleware
- type MuxGroup
- func (g *MuxGroup) Group(path string, middlewares ...Middleware) *MuxGroup
- func (g *MuxGroup) NotFound(h http.Handler) http.Handler
- func (g *MuxGroup) Pack(path string, middlewares ...Middleware) *MuxGroup
- func (g *MuxGroup) Path(p string) string
- func (g *MuxGroup) R(r RegisterFunc, p string, handle httprouter.Handle)
- func (g *MuxGroup) Use(middlewares ...Middleware)
- type RegisterFunc
- type StdFuncMiddlware
- type StdMiddlware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapF ¶
func WrapF(f http.HandlerFunc) httprouter.Handle
Types ¶
type Middleware ¶
type Middleware func(httprouter.Handle) httprouter.Handle
func WrapM ¶
func WrapM(sm StdFuncMiddlware) Middleware
func WrapS ¶
func WrapS(sm StdMiddlware) Middleware
type MuxGroup ¶
type MuxGroup struct {
// contains filtered or unexported fields
}
func NewGroup ¶
func NewGroup(basePath string, middlewares ...Middleware) *MuxGroup
func (*MuxGroup) Group ¶
func (g *MuxGroup) Group(path string, middlewares ...Middleware) *MuxGroup
Group returns new MuxGroup with appending inputs middlewares to the end of current muxgroup's middleware
func (*MuxGroup) Pack ¶
func (g *MuxGroup) Pack(path string, middlewares ...Middleware) *MuxGroup
Pack returns new MuxGroup with appending current muxgroup's middlewares to the end of input middlewarse
func (*MuxGroup) R ¶
func (g *MuxGroup) R(r RegisterFunc, p string, handle httprouter.Handle)
func (*MuxGroup) Use ¶
func (g *MuxGroup) Use(middlewares ...Middleware)
Deprecated. Use Group or Pack. https://stackoverflow.com/questions/53572736/append-to-a-new-slice-affect-original-slice
type RegisterFunc ¶
type RegisterFunc func(path string, handle httprouter.Handle)
type StdFuncMiddlware ¶
type StdFuncMiddlware func(http.HandlerFunc) http.HandlerFunc
Click to show internal directories.
Click to hide internal directories.