Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Module ¶
type Module struct {
Secret string `json:"secret,omitempty"`
CookieName string `json:"cookie_name,omitempty"`
Upstreams []*Upstream `json:"upstreams,omitempty"`
// contains filtered or unexported fields
}
func (Module) CaddyModule ¶
func (Module) CaddyModule() caddy.ModuleInfo
type Upstream ¶
type Upstream struct {
CIDR string `json:"cidr,omitempty"`
Port int `json:"port,omitempty"`
Host string `json:"host,omitempty"`
// contains filtered or unexported fields
}
func (*Upstream) Resolve ¶ added in v0.1.7
func (u *Upstream) Resolve(ctx context.Context, ttl, timeout time.Duration, logger *zap.Logger) (*reverseproxy.Upstream, error)
Resolve returns an upstream for this host, resolving Host to a raw IP. The resolved address is cached for ttl and refreshed by a single collapsed lookup; concurrent callers during an in-flight lookup wait on the entry's channel, or bail if their request context is cancelled.
A fresh *reverseproxy.Upstream is built on every call rather than cached: reverse_proxy writes into the struct per request (Host, cb, healthCheckPolicy via provisionUpstream), so a shared pointer would be a data race. Only the address is cached — the expensive part.
Click to show internal directories.
Click to hide internal directories.