Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Proxy ¶
func Proxy(config ProxyConfig) makross.Handler
Proxy returns an HTTP/WebSocket reverse proxy middleware.
Types ¶
type ProxyBalancer ¶
type ProxyBalancer interface {
Next() *ProxyTarget
}
ProxyBalancer defines an interface to implement a load balancing technique.
type ProxyConfig ¶
type ProxyConfig struct {
// Skipper defines a function to skip middleware.
Skipper skipper.Skipper
// Balancer defines a load balancing technique.
// Required.
// Possible values:
// - RandomBalancer
// - RoundRobinBalancer
Balancer ProxyBalancer
}
ProxyConfig defines the config for Proxy middleware.
type ProxyTarget ¶
ProxyTarget defines the upstream target.
type RandomBalancer ¶
type RandomBalancer struct {
Targets []*ProxyTarget
// contains filtered or unexported fields
}
RandomBalancer implements a random load balancing technique.
func (*RandomBalancer) Next ¶
func (r *RandomBalancer) Next() *ProxyTarget
Next randomly returns an upstream target.
type RoundRobinBalancer ¶
type RoundRobinBalancer struct {
Targets []*ProxyTarget
// contains filtered or unexported fields
}
RoundRobinBalancer implements a round-robin load balancing technique.
func (*RoundRobinBalancer) Next ¶
func (r *RoundRobinBalancer) Next() *ProxyTarget
Next returns an upstream target using round-robin technique.
Click to show internal directories.
Click to hide internal directories.