import "github.com/astaxie/beego/core/admin"
Package admin healthcheck
type DatabaseCheck struct { }
func (dc *DatabaseCheck) Check() error {
if dc.isConnected() { return nil } else { return errors.New("can't connect database") }
}
AddHealthCheck("database",&DatabaseCheck{})
more docs: http://beego.me/docs/module/toolbox.md
command.go healthcheck.go profile.go
var AdminCheckList map[string]HealthChecker
AdminCheckList holds health checker map
func AddHealthCheck(name string, hc HealthChecker)
AddHealthCheck add health checker with name string
GetCPUProfile start cpu profile monitor
MemProf record memory profile in pprof
PrintGCSummary print gc information to io.Writer
ProcessInput parse input command string
RegisterCommand is not thread-safe do not use it in concurrent case
Command is an experimental interface We try to use this to decouple modules All other modules depends on this, and they register the command they support We may change the API in the future, so be careful about this.
HealthChecker health checker interface
type Result struct { // Status is the same as http.Status Status int Error error Content interface{} }
Package admin imports 12 packages (graph) and is imported by 4 packages. Updated 2020-12-16. Refresh now. Tools for package owners. This is a dead-end fork (no commits since the fork).