Documentation ¶
Overview ¶
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.vip/docs/module/toolbox.md
Index ¶
- Variables
- func AddHealthCheck(name string, hc HealthChecker)
- func GetCPUProfile(w io.Writer)
- func MemProf(w io.Writer)
- func PrintGCSummary(w io.Writer)
- func ProcessInput(input string, w io.Writer)
- func RegisterCommand(module string, commandName string, command Command)
- type Command
- type HealthChecker
- type Result
Constants ¶
This section is empty.
Variables ¶
View Source
var AdminCheckList map[string]HealthChecker
AdminCheckList holds health checker map
View Source
var CommandNotFound = errors.New("Command not found")
Functions ¶
func AddHealthCheck ¶
func AddHealthCheck(name string, hc HealthChecker)
AddHealthCheck add health checker with name string
func PrintGCSummary ¶
PrintGCSummary print gc information to io.Writer
func ProcessInput ¶
ProcessInput parse input command string
func RegisterCommand ¶
RegisterCommand is not thread-safe do not use it in concurrent case
Types ¶
type Command ¶
type Command interface {
Execute(params ...interface{}) *Result
}
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.
func GetCommand ¶
type HealthChecker ¶
type HealthChecker interface {
Check() error
}
HealthChecker health checker interface
Click to show internal directories.
Click to hide internal directories.