go vendor
This commit is contained in:
39
vendor/github.com/revel/modules/pprof/app/controllers/pprof.go
generated
vendored
Normal file
39
vendor/github.com/revel/modules/pprof/app/controllers/pprof.go
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/revel/revel"
|
||||
"net/http"
|
||||
"net/http/pprof"
|
||||
)
|
||||
|
||||
type Pprof struct {
|
||||
*revel.Controller
|
||||
}
|
||||
|
||||
// The PprofHandler type makes it easy to call the net/http/pprof handler methods
|
||||
// since they all have the same method signature
|
||||
type PprofHandler func(http.ResponseWriter, *http.Request)
|
||||
|
||||
func (r PprofHandler) Apply(req *revel.Request, resp *revel.Response) {
|
||||
r(resp.Out.Server.GetRaw().(http.ResponseWriter), req.In.GetRaw().(*http.Request))
|
||||
}
|
||||
|
||||
func (c Pprof) Profile() revel.Result {
|
||||
return PprofHandler(pprof.Profile)
|
||||
}
|
||||
|
||||
func (c Pprof) Symbol() revel.Result {
|
||||
return PprofHandler(pprof.Symbol)
|
||||
}
|
||||
|
||||
func (c Pprof) Cmdline() revel.Result {
|
||||
return PprofHandler(pprof.Cmdline)
|
||||
}
|
||||
|
||||
func (c Pprof) Trace() revel.Result {
|
||||
return PprofHandler(pprof.Trace)
|
||||
}
|
||||
|
||||
func (c Pprof) Index() revel.Result {
|
||||
return PprofHandler(pprof.Index)
|
||||
}
|
||||
Reference in New Issue
Block a user