mirror of
https://github.com/caddyserver/caddy.git
synced 2026-09-01 00:48:03 +00:00
Remove dead code, do struct alignment, simplify code
This commit is contained in:
parent
c4d64a418b
commit
8cc3416bbc
13 changed files with 34 additions and 99 deletions
|
|
@ -46,17 +46,17 @@ type UpstreamHostDownFunc func(*UpstreamHost) bool
|
|||
|
||||
// UpstreamHost represents a single proxy upstream
|
||||
type UpstreamHost struct {
|
||||
Conns int64 // must be first field to be 64-bit aligned on 32-bit systems
|
||||
Conns int64 // must be first field to be 64-bit aligned on 32-bit systems
|
||||
MaxConns int64
|
||||
Name string // hostname of this upstream host
|
||||
ReverseProxy *ReverseProxy
|
||||
Fails int32
|
||||
FailTimeout time.Duration
|
||||
Unhealthy bool
|
||||
UpstreamHeaders http.Header
|
||||
DownstreamHeaders http.Header
|
||||
FailTimeout time.Duration
|
||||
CheckDown UpstreamHostDownFunc
|
||||
WithoutPathPrefix string
|
||||
MaxConns int64
|
||||
ReverseProxy *ReverseProxy
|
||||
Fails int32
|
||||
Unhealthy bool
|
||||
}
|
||||
|
||||
// Down checks whether the upstream host is down or not.
|
||||
|
|
|
|||
|
|
@ -21,27 +21,26 @@ var (
|
|||
)
|
||||
|
||||
type staticUpstream struct {
|
||||
from string
|
||||
upstreamHeaders http.Header
|
||||
downstreamHeaders http.Header
|
||||
Hosts HostPool
|
||||
Policy Policy
|
||||
KeepAlive int
|
||||
insecureSkipVerify bool
|
||||
|
||||
FailTimeout time.Duration
|
||||
MaxFails int32
|
||||
TryDuration time.Duration
|
||||
TryInterval time.Duration
|
||||
MaxConns int64
|
||||
HealthCheck struct {
|
||||
from string
|
||||
upstreamHeaders http.Header
|
||||
downstreamHeaders http.Header
|
||||
Hosts HostPool
|
||||
Policy Policy
|
||||
KeepAlive int
|
||||
FailTimeout time.Duration
|
||||
TryDuration time.Duration
|
||||
TryInterval time.Duration
|
||||
MaxConns int64
|
||||
HealthCheck struct {
|
||||
Client http.Client
|
||||
Path string
|
||||
Interval time.Duration
|
||||
Timeout time.Duration
|
||||
}
|
||||
WithoutPathPrefix string
|
||||
IgnoredSubPaths []string
|
||||
WithoutPathPrefix string
|
||||
IgnoredSubPaths []string
|
||||
insecureSkipVerify bool
|
||||
MaxFails int32
|
||||
}
|
||||
|
||||
// NewStaticUpstreams parses the configuration input and sets up
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue