@@ -35,7 +35,7 @@ import (
3535var beeAdminApp * adminApp
3636
3737// FilterMonitorFunc is default monitor filter when admin module is enable.
38- // if this func returns, admin module records qbs for this request by condition of this function logic.
38+ // if this func returns, admin module records qps for this request by condition of this function logic.
3939// usage:
4040// func MyFilterMonitor(method, requestPath string, t time.Duration, pattern string, statusCode int) bool {
4141// if method == "POST" {
@@ -67,18 +67,18 @@ func init() {
6767
6868// AdminIndex is the default http.Handler for admin module.
6969// it matches url pattern "/".
70- func adminIndex (rw http.ResponseWriter , r * http.Request ) {
70+ func adminIndex (rw http.ResponseWriter , _ * http.Request ) {
7171 execTpl (rw , map [interface {}]interface {}{}, indexTpl , defaultScriptsTpl )
7272}
7373
74- // QpsIndex is the http.Handler for writing qbs statistics map result info in http.ResponseWriter.
75- // it's registered with url pattern "/qbs " in admin module.
76- func qpsIndex (rw http.ResponseWriter , r * http.Request ) {
74+ // QpsIndex is the http.Handler for writing qps statistics map result info in http.ResponseWriter.
75+ // it's registered with url pattern "/qps " in admin module.
76+ func qpsIndex (rw http.ResponseWriter , _ * http.Request ) {
7777 data := make (map [interface {}]interface {})
7878 data ["Content" ] = toolbox .StatisticsMap .GetMap ()
7979
8080 // do html escape before display path, avoid xss
81- if content , ok := (data ["Content" ]).(map [ string ] interface {} ); ok {
81+ if content , ok := (data ["Content" ]).(M ); ok {
8282 if resultLists , ok := (content ["Data" ]).([][]string ); ok {
8383 for i := range resultLists {
8484 if len (resultLists [i ]) > 0 {
@@ -104,7 +104,7 @@ func listConf(rw http.ResponseWriter, r *http.Request) {
104104 data := make (map [interface {}]interface {})
105105 switch command {
106106 case "conf" :
107- m := make (map [ string ] interface {} )
107+ m := make (M )
108108 list ("BConfig" , BConfig , m )
109109 m ["AppConfigPath" ] = appConfigPath
110110 m ["AppConfigProvider" ] = appConfigProvider
@@ -128,14 +128,14 @@ func listConf(rw http.ResponseWriter, r *http.Request) {
128128 execTpl (rw , data , routerAndFilterTpl , defaultScriptsTpl )
129129 case "filter" :
130130 var (
131- content = map [ string ] interface {} {
131+ content = M {
132132 "Fields" : []string {
133133 "Router Pattern" ,
134134 "Filter Function" ,
135135 },
136136 }
137137 filterTypes = []string {}
138- filterTypeData = make (map [ string ] interface {} )
138+ filterTypeData = make (M )
139139 )
140140
141141 if BeeApp .Handlers .enableFilter {
@@ -173,7 +173,7 @@ func listConf(rw http.ResponseWriter, r *http.Request) {
173173 }
174174}
175175
176- func list (root string , p interface {}, m map [ string ] interface {} ) {
176+ func list (root string , p interface {}, m M ) {
177177 pt := reflect .TypeOf (p )
178178 pv := reflect .ValueOf (p )
179179 if pt .Kind () == reflect .Ptr {
@@ -196,11 +196,11 @@ func list(root string, p interface{}, m map[string]interface{}) {
196196}
197197
198198// PrintTree prints all registered routers.
199- func PrintTree () map [ string ] interface {} {
199+ func PrintTree () M {
200200 var (
201- content = map [ string ] interface {} {}
201+ content = M {}
202202 methods = []string {}
203- methodsData = make (map [ string ] interface {} )
203+ methodsData = make (M )
204204 )
205205 for method , t := range BeeApp .Handlers .routers {
206206
@@ -291,12 +291,12 @@ func profIndex(rw http.ResponseWriter, r *http.Request) {
291291
292292// Healthcheck is a http.Handler calling health checking and showing the result.
293293// it's in "/healthcheck" pattern in admin module.
294- func healthcheck (rw http.ResponseWriter , req * http.Request ) {
294+ func healthcheck (rw http.ResponseWriter , _ * http.Request ) {
295295 var (
296296 result []string
297297 data = make (map [interface {}]interface {})
298298 resultList = new ([][]string )
299- content = map [ string ] interface {} {
299+ content = M {
300300 "Fields" : []string {"Name" , "Message" , "Status" },
301301 }
302302 )
@@ -344,7 +344,7 @@ func taskStatus(rw http.ResponseWriter, req *http.Request) {
344344 }
345345
346346 // List Tasks
347- content := make (map [ string ] interface {} )
347+ content := make (M )
348348 resultList := new ([][]string )
349349 var fields = []string {
350350 "Task Name" ,
0 commit comments