add listconf fix #351

This commit is contained in:
astaxie
2013-12-15 21:22:50 +08:00
parent aea3c68c98
commit f26c19052d
3 changed files with 151 additions and 42 deletions

View File

@@ -1,10 +1,5 @@
package toolbox
import (
"fmt"
"net/http"
)
//type DatabaseCheck struct {
//}
@@ -28,16 +23,6 @@ func AddHealthCheck(name string, hc HealthChecker) {
AdminCheckList[name] = hc
}
func Healthcheck(rw http.ResponseWriter, req *http.Request) {
for name, h := range AdminCheckList {
if err := h.Check(); err != nil {
fmt.Fprintf(rw, "%s : ok\n", name)
} else {
fmt.Fprintf(rw, "%s : %s\n", name, err.Error())
}
}
}
func init() {
AdminCheckList = make(map[string]HealthChecker)
}