2020-09-13 19:27:47 +08:00
|
|
|
package serverconfigs
|
|
|
|
|
|
2020-10-17 21:15:37 +08:00
|
|
|
import (
|
|
|
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
|
|
|
|
"github.com/iwind/TeaGo/maps"
|
|
|
|
|
)
|
2020-09-13 19:27:47 +08:00
|
|
|
|
2020-09-27 15:25:52 +08:00
|
|
|
// 健康检查设置
|
2020-09-13 19:27:47 +08:00
|
|
|
type HealthCheckConfig struct {
|
2020-10-17 21:15:37 +08:00
|
|
|
IsOn bool `yaml:"isOn" json:"isOn"` // 是否开启
|
|
|
|
|
URL string `yaml:"url" json:"url"` // 读取的URL
|
|
|
|
|
Interval *shared.TimeDuration `yaml:"interval" json:"interval"` // 检测周期
|
|
|
|
|
StatusCodes []int `yaml:"statusCodes" json:"statusCodes"` // 返回的状态码要求
|
|
|
|
|
Timeout *shared.TimeDuration `yaml:"timeout" json:"timeout"` // 超时时间
|
|
|
|
|
CountTries int64 `yaml:"countTries" json:"countTries"` // 尝试次数
|
|
|
|
|
TryDelay *shared.TimeDuration `yaml:"tryDelay" json:"tryDelay"` // 尝试间隔
|
|
|
|
|
FailActions []maps.Map `yaml:"failActions" json:"failActions"` // 失败采取的动作
|
|
|
|
|
RecoverActions []maps.Map `yaml:"recoverActions" json:"recoverActions"` // 恢复采取的动作
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
2020-09-27 15:25:52 +08:00
|
|
|
|
|
|
|
|
// 初始化
|
|
|
|
|
func (this *HealthCheckConfig) Init() error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|