any
func(Handler) Handler
{
fg.g.Handle(m, p, h.(fasthttp.RequestHandler))
}
{ return &fastGroup{g: fg.g.Group(prefix)} }
{ return nil }
{ return nil }
{ return fg.g }
{
final := h.(fasthttp.RequestHandler)
for i := len(f.mwChain) - 1; i >= 0; i-- {
final = f.mwChain[i](final).(fasthttp.RequestHandler)
}
f.r.Handle(m, p, final)
}
{ f.mwChain = append(f.mwChain, mw) }
{
return &fastGroup{g: f.r.Group(prefix)}
}
{
f.srv = &fasthttp.Server{Handler: f.r.Handler}
return f.srv.ListenAndServe(addr)
}
{
if f.srv == nil {
return nil
}
return f.srv.ShutdownWithContext(ctx)
}
{ return f.r }
{
return &FastHTTP{r: router.New()}
}
{
final := h.(http.Handler)
for i := len(s.mwChain) - 1; i >= 0; i-- {
final = s.mwChain[i](final).(http.Handler)
}
switch m {
case http.MethodGet:
s.mux.Handle(p, final)
default:
s.mux.HandleFunc(p, func(w http.ResponseWriter, r *http.Request) {
if r.Method != m {
http.NotFound(w, r)
return
}
final.ServeHTTP(w, r)
})
}
}
{ s.mwChain = append(s.mwChain, mw) }
{
sub := NewStdHTTP()
sub.mwChain = s.mwChain
s.mux.Handle(prefix+"/", http.StripPrefix(prefix, sub.mux))
return sub
}
{
s.srv = &http.Server{Addr: addr, Handler: s.mux}
return s.srv.ListenAndServe()
}
{
if s.srv == nil {
return nil
}
return s.srv.Shutdown(ctx)
}
{ return s.mux }
{
return &StdHTTP{mux: http.NewServeMux()}
}
import "context"
import "context"
import "github.com/fasthttp/router"
import "github.com/valyala/fasthttp"
import "context"
import "net/http"