mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 12:42:34 +02:00
22 lines
638 B
Go
22 lines
638 B
Go
package health
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/yusing/go-proxy/internal/common"
|
|
)
|
|
|
|
type HealthCheckConfig struct {
|
|
Disable bool `json:"disable,omitempty" aliases:"disabled"`
|
|
Path string `json:"path,omitempty" validate:"omitempty,uri,startswith=/"`
|
|
UseGet bool `json:"use_get,omitempty"`
|
|
Interval time.Duration `json:"interval" validate:"omitempty,min=1s"`
|
|
Timeout time.Duration `json:"timeout" validate:"omitempty,min=1s"`
|
|
}
|
|
|
|
func DefaultHealthConfig() *HealthCheckConfig {
|
|
return &HealthCheckConfig{
|
|
Interval: common.HealthCheckIntervalDefault,
|
|
Timeout: common.HealthCheckTimeoutDefault,
|
|
}
|
|
}
|