1 Star 0 Fork 0

h79/goutils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
node.go 516 Bytes
一键复制 编辑 原始数据 按行查看 历史
huqiuyun 提交于 2年前 . 服务发现大调整
package health
import "gitee.com/h79/goutils/common/server"
type Unpack func(body []byte, node *Node) error
type CheckFunc func(node *Node) error
type Node struct {
Health server.Health
// http检测后,服务器返回的body,由业务根据情况不同去解释
Unpack Unpack
// 可以配自己的检测函数
Check CheckFunc
// 结点状态
Status int
// 错误几次
errCount int
}
func (n Node) URL() string {
return n.Health.URL.To()
}
func (n Node) Id() string {
return n.Health.URL.To()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/h79/goutils.git
git@gitee.com:h79/goutils.git
h79
goutils
goutils
v1.20.98

搜索帮助