Documentation ¶ Index ¶ func Register(ci Checker) type ChaosChecker func (c *ChaosChecker) Check() (bool, map[string]string, string) func (c *ChaosChecker) Enabled() bool func (c *ChaosChecker) GetName() string type Checker type Result func CheckAll() (bool, []Result) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Register ¶ func Register(ci Checker) Register 注册健康检查项 Types ¶ type ChaosChecker ¶ type ChaosChecker struct{} ChaosChecker 故障注入器,用户随机地向健康检查注入失败检查项 func (*ChaosChecker) Check ¶ func (c *ChaosChecker) Check() (bool, map[string]string, string) Check 检查可用状态 func (*ChaosChecker) Enabled ¶ func (c *ChaosChecker) Enabled() bool Enabled 是否启用 func (*ChaosChecker) GetName ¶ func (c *ChaosChecker) GetName() string GetName 获取名称 type Checker ¶ type Checker interface { GetName() string Enabled() bool Check() (isOk bool, tags map[string]string, message string) // 实现具体的检查逻辑 } Checker 用于表征一个业务健康度的检查项 type Result ¶ type Result struct { Name string `json:"name"` OK bool `json:"ok"` Tags map[string]string `json:"tags,omitempty"` // 检查结果的附加信息 Message string `json:"message,omitempty"` // 检查结果描述 } Result 检查项结果 func CheckAll ¶ func CheckAll() (bool, []Result) CheckAll 对所有检查项发起检查 Source Files ¶ View all Source files chaos.go checker.go health.go Click to show internal directories. Click to hide internal directories.