Documentation
¶
Index ¶
Constants ¶
View Source
const MaxWeight = 65535
MaxWeight is the maximum value for the destination weight. The minimum value is zero.
Variables ¶
View Source
var ErrInvalidIP = errors.New("invalid IP address")
ErrInvalidIP is the error which is returned when an IP address is invalid.
Functions ¶
This section is empty.
Types ¶
type APIConfig ¶
type APIConfig struct {
ListenAddress string `yaml:"listen_address"`
AccessLog string `yaml:"access_log"`
}
APIConfig is the configuration about API server.
type Config ¶
type Config struct {
PIDFile string `yaml:"pid_file"`
ErrorLog string `yaml:"error_log"`
EnableDebugLog bool `yaml:"enable_debug_log"`
API APIConfig `yaml:"api"`
VRRP VRRPConfig `yaml:"vrrp"`
Services []ServiceConfig `yaml:"services"`
// contains filtered or unexported fields
}
Config is the configuration object for the load balancer.
func LoadConfig ¶
LoadConfig loads the configuration from a file.
type DestinationConfig ¶
type DestinationConfig struct {
Address netutil.IP `yaml:"address"`
Port uint16 `yaml:"port"`
Weight uint16 `yaml:"weight"`
HealthCheck HealthCheckConfig `yaml:"health_check"`
Detached bool `yaml:"detached"`
Locked bool `yaml:"locked"`
}
DestinationConfig is the configuration about the destination.
type HealthCheckConfig ¶
type HealthCheckConfig struct {
URL string `yaml:"url"`
HostHeader string `yaml:"host_header"`
EnableKeepAlive bool `yaml:"enable_keep_alive"`
SkipVerifyCert bool `yaml:"skip_verify_cert"`
OKStatus int `yaml:"ok_status"`
Timeout time.Duration `yaml:"timeout"`
Interval time.Duration `yaml:"interval"`
}
HealthCheckConfig is the configuration about the health check.
type LoadBalancer ¶
type LoadBalancer struct {
// contains filtered or unexported fields
}
LoadBalancer is the load balancer.
func (*LoadBalancer) SetKeepVIPsDuringRestart ¶
func (l *LoadBalancer) SetKeepVIPsDuringRestart(keep bool)
type ServiceConfig ¶
type ServiceConfig struct {
Name string `yaml:"name"`
Address netutil.IP `yaml:"address"`
Port uint16 `yaml:"port"`
Schedule string `yaml:"schedule"`
Type string `yaml:"type"`
Destinations []DestinationConfig `yaml:"destinations"`
}
ServiceConfig is the configuration on the service.
type VRRPConfig ¶
type VRRPConfig struct {
Enabled bool `yaml:"enabled"`
VRID uint8 `yaml:"vrid"`
Priority uint8 `yaml:"priority"`
LocalAddress string `yaml:"local_address"`
RemoteAddress string `yaml:"remote_address"`
Preempt bool `yaml:"preempt"`
MasterAdvertInterval time.Duration `yaml:"master_advert_interval"`
SendGARPInterval time.Duration `yaml:"send_garp_interval"`
VIPInterface string `yaml:"vip_interface"`
VIPs []string `yaml:"vips"`
}
VRRPConfig is the configuration about VRRP.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
