Documentation ¶
Index ¶
- func Factory(config Config, logger *zap.Logger) (*http_lb.Frontend, *http_lb.HealthCheck)
- func FrontendFactory(frontend Frontend, reqForwarder http_lb.RequestForwarder, logger *zap.Logger) *http_lb.Frontend
- func HealthCheckFactory(healthCheck HealthCheck, serverPool http_lb.ServerPool, logger *zap.Logger) *http_lb.HealthCheck
- func LoadBalancingAlgorithmFactory(serverPool http_lb.ServerPool, hash http_lb.HashingAlgorithm, ...) func(algorithmName string) http_lb.LoadBalancingAlgorithm
- func RequestForwarderFactory(lbAlgo http_lb.LoadBalancingAlgorithm, rpFactory http_lb.ReverseProxyFactory, ...) http_lb.RequestForwarder
- func ServerPoolFactory(backendsConfig Backend, logger *zap.Logger) http_lb.ServerPool
- type Backend
- type Config
- type Frontend
- type HealthCheck
- type KeepAlive
- type TLS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FrontendFactory ¶
func HealthCheckFactory ¶
func HealthCheckFactory(healthCheck HealthCheck, serverPool http_lb.ServerPool, logger *zap.Logger) *http_lb.HealthCheck
func LoadBalancingAlgorithmFactory ¶
func LoadBalancingAlgorithmFactory(serverPool http_lb.ServerPool, hash http_lb.HashingAlgorithm, logger *zap.Logger) func(algorithmName string) http_lb.LoadBalancingAlgorithm
func RequestForwarderFactory ¶
func RequestForwarderFactory(lbAlgo http_lb.LoadBalancingAlgorithm, rpFactory http_lb.ReverseProxyFactory, logger *zap.Logger) http_lb.RequestForwarder
func ServerPoolFactory ¶
func ServerPoolFactory(backendsConfig Backend, logger *zap.Logger) http_lb.ServerPool
Types ¶
type Config ¶
type Config struct { Algorithm string `mapstructure:"algorithm" validate:"oneof=round-robin sticky-round-robin weighted-round-robin url-hash ip-hash random"` LogLevel string `mapstructure:"log_level" validate:"oneof=debug info warn error"` Frontend Frontend `mapstructure:"frontend" validate:"required"` Backend Backend `mapstructure:"backend" validate:"required"` HealthCheck HealthCheck `mapstructure:"health_check" validate:"required"` }
func ParseAndValidateConfig ¶
type HealthCheck ¶
type HealthCheck struct { Endpoint string `mapstructure:"endpoint" validate:"uri,required"` ExpectedStatusCode int `mapstructure:"expected_status_code" validate:"min=100,max=599,required"` Interval time.Duration `mapstructure:"interval" validate:"min=1ms,required"` Timeout time.Duration `mapstructure:"timeout" validate:"min=1ms,required"` }
Click to show internal directories.
Click to hide internal directories.