mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 20:52:33 +02:00

* cleanup code for URL type * fix makefile for trace mode * refactor, merge Entry, RawEntry and Route into one. * Implement fileserver. * refactor: rename HTTPRoute to ReverseProxyRoute to avoid confusion * refactor: move metrics logger to middleware package - fix prometheus metrics for load balanced routes - route will now fail when health monitor fail to start * fix extra output of ls-* commands by defer initializaing stuff, speed up start time * add test for path traversal attack, small fix on FileServer.Start method * rename rule.on.bypass to pass * refactor and fixed map-to-map deserialization * updated route loading logic * schemas: add "add_prefix" option to modify_request middleware * updated route JSONMarshalling --------- Co-authored-by: yusing <yusing@6uo.me>
20 lines
603 B
Go
20 lines
603 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"`
|
|
}
|
|
|
|
var DefaultHealthConfig = &HealthCheckConfig{
|
|
Interval: common.HealthCheckIntervalDefault,
|
|
Timeout: common.HealthCheckTimeoutDefault,
|
|
}
|