mirror of
https://github.com/golang/go
synced 2024-11-22 07:34:40 -07:00
rpc: convert /debug/rpc handler to exp/template
R=golang-dev, adg CC=golang-dev https://golang.org/cl/4819048
This commit is contained in:
parent
e21f69338b
commit
7e1101d470
@ -10,33 +10,33 @@ package rpc
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"exp/template"
|
||||||
"fmt"
|
"fmt"
|
||||||
"http"
|
"http"
|
||||||
"sort"
|
"sort"
|
||||||
"template"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const debugText = `<html>
|
const debugText = `<html>
|
||||||
<body>
|
<body>
|
||||||
<title>Services</title>
|
<title>Services</title>
|
||||||
{.repeated section @}
|
{{range .}}
|
||||||
<hr>
|
<hr>
|
||||||
Service {Name}
|
Service {{.Name}}
|
||||||
<hr>
|
<hr>
|
||||||
<table>
|
<table>
|
||||||
<th align=center>Method</th><th align=center>Calls</th>
|
<th align=center>Method</th><th align=center>Calls</th>
|
||||||
{.repeated section Method}
|
{{range .Method}}
|
||||||
<tr>
|
<tr>
|
||||||
<td align=left font=fixed>{Name}({Type.ArgType}, {Type.ReplyType}) os.Error</td>
|
<td align=left font=fixed>{{.Name}}({{.Type.ArgType}}, {{.Type.ReplyType}}) os.Error</td>
|
||||||
<td align=center>{Type.NumCalls}</td>
|
<td align=center>{{.Type.NumCalls}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{.end}
|
{{end}}
|
||||||
</table>
|
</table>
|
||||||
{.end}
|
{{end}}
|
||||||
</body>
|
</body>
|
||||||
</html>`
|
</html>`
|
||||||
|
|
||||||
var debug = template.MustParse(debugText, nil)
|
var debug = template.New("RPC debug").MustParse(debugText)
|
||||||
|
|
||||||
type debugMethod struct {
|
type debugMethod struct {
|
||||||
Type *methodType
|
Type *methodType
|
||||||
|
Loading…
Reference in New Issue
Block a user