Documentation
¶
Overview ¶
Package health API 状态检测
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Health ¶
type Health struct { Enabled bool // 是否启用当前的中间件 // contains filtered or unexported fields }
Health API 状态检测
func (*Health) Middleware ¶
Middleware 将当前中间件应用于 next
func (*Health) MiddlewareFunc ¶
MiddlewareFunc 将当前中间件应用于 next
type State ¶
type State struct {
Method, Path string
Min, Max time.Duration
Count int // 总的请求次数
UserErrors int // 用户端出错次数,400-499
ServerErrors int // 服务端出错次数,>500
Last time.Time // 最后的访问时间
Spend time.Duration // 总花费的时间
}
State 实际存在的数据类型
Click to show internal directories.
Click to hide internal directories.