Documentation
¶
Index ¶
Constants ¶
View Source
const ( IPHash = "ip-hash" RoundRobin = "round-robin" LeastConnections = "least-connections" )
Represents name of balancing algorithm.
Variables ¶
This section is empty.
Functions ¶
func WithBalancingHandlerDirector ¶
func WithBalancingHandlerDirector(d HandlerDirector) func(*serverLoadBalancer)
WithBalancingHandlerDirector returns an Option that sets the Balancer.Handler implementation.
Types ¶
type Config ¶
type Config struct { Host string `yaml:"host"` Port string `yaml:"port"` TLSConfig `yaml:"tls"` Balancing Balancing `yaml:"balancing"` BackendServerConfigs ServerConfigs `yaml:"servers"` }
Config represents an application configuration content (config.yaml).
type HandlerDirector ¶
HandlerDirector type is director to generate handler.Handler implementation.
type ServerConfig ¶
type ServerConfig struct { Scheme string `yaml:"scheme"` Host string `yaml:"host"` Port string `yaml:"port"` // contains filtered or unexported fields }
ServerConfig represents configuration content for server.
func (ServerConfig) String ¶
func (sc ServerConfig) String() string
type TLSConfig ¶
type TLSConfig struct { // Enable represents the server load balancer enable TLS or not. Enabled bool `yaml:"enabled"` // CertKey represents the environment variable name having the certificate file path of server load balancer. CertKey string `yaml:"cert_key"` // KeyKey represents the environment variable name having the private key file path of server load balancer certificate. KeyKey string `yaml:"key_key"` }
TLSConfig represents the TLS configuration for server load balancer.
Click to show internal directories.
Click to hide internal directories.