Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Node ¶
type Node struct {
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"`
Weight int `json:"weight,omitempty"`
Priority int `json:"priority,omitempty"`
// contains filtered or unexported fields
}
func (*Node) UnmarshalJSON ¶
type Override ¶
type Override struct {
Scheme string
Host string
PassHost string
UpstreamHost string
Timeout resource.Timeout
Retries int
NextRetry func(*http.Request) *Override
HealthReporter pxy.HealthReporter
HealthTarget string
RoundTripper http.RoundTripper
}
func GetOverride ¶
type Plugin ¶
type Plugin struct {
base.BasePlugin
// contains filtered or unexported fields
}
func (*Plugin) SetRuntimeAcquirer ¶
func (p *Plugin) SetRuntimeAcquirer(acquirer RuntimeAcquirer)
SetRuntimeAcquirer supplies the route-owned materializer before PostInit.
func (*Plugin) SetUpstreamResolver ¶
func (p *Plugin) SetUpstreamResolver(resolver ResourceUpstreamResolver)
SetUpstreamResolver supplies the immutable generation's upstream resolver before PostInit.
type ResourceUpstreamResolver ¶
ResourceUpstreamResolver resolves an upstream_id from the route builder's current Store generation before PostInit compiles the weighted targets.
type Rule ¶
type Rule struct {
Match []Match `json:"match,omitempty"`
WeightedUpstreams []WeightedUpstream `json:"weighted_upstreams,omitempty"`
}
type Runtime ¶
type Runtime struct {
LoadBalancer pxy.LoadBalancer
RoundTripper http.RoundTripper
}
Runtime contains the reusable cluster-owned state for one weighted upstream. The route builder materializes it once per route generation.
type RuntimeAcquirer ¶
type RuntimeAcquirer interface {
Acquire(upstream *Upstream, targets map[string]int, priorities map[string]int) (*Runtime, error)
}
RuntimeAcquirer materializes a weighted upstream through the route-owned cluster registry. It accepts concrete target identities so active probes and passive health use the same keys as request selection.
type Upstream ¶
type Upstream struct {
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Scheme string `json:"scheme,omitempty"`
TLS *resource.UpstreamTLS `json:"tls,omitempty"`
PassHost string `json:"pass_host,omitempty"`
UpstreamHost string `json:"upstream_host,omitempty"`
HashOn string `json:"hash_on,omitempty"`
Key string `json:"key,omitempty"`
Timeout resource.Timeout `json:"timeout"`
Retries int `json:"retries,omitempty"`
Checks map[string]any `json:"checks,omitempty"`
Nodes []Node `json:"nodes,omitempty"`
// contains filtered or unexported fields
}
func (Upstream) RetriesConfigured ¶
RetriesConfigured reports whether retries was explicitly present, including an explicit zero.
func (*Upstream) UnmarshalJSON ¶
type WeightedUpstream ¶
type WeightedUpstream struct {
UpstreamID string `json:"upstream_id,omitempty"`
Upstream *Upstream `json:"upstream,omitempty"`
Weight int `json:"weight,omitempty"`
// contains filtered or unexported fields
}
func (*WeightedUpstream) UnmarshalJSON ¶
func (w *WeightedUpstream) UnmarshalJSON(data []byte) error