loadbalancer

package
v0.6.0-alpha.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2020 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package loadbalancer provides simple TCP loadbalancer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TCP

type TCP struct {
	tcpproxy.Proxy
}

TCP is a simple loadbalancer for TCP connections across a set of upstreams.

Healthcheck is defined as TCP dial attempt by default.

Zero value of TCP is a valid proxy, use `AddRoute` to install load balancer for address.

Usage: call Run() to start lb and wait for shutdown, call Close() to shutdown lb.

func (*TCP) AddRoute

func (t *TCP) AddRoute(ipPort string, upstreamAddrs []string, options ...upstream.ListOption) error

AddRoute installs load balancer route from listen address ipAddr to list of upstreams.

TCP automatically does background health checks for the upstreams and picks only healthy ones. Healthcheck is simple Dial attempt.

Directories

Path Synopsis
Package upstream provides utilities for choosing upstream backends based on score.
Package upstream provides utilities for choosing upstream backends based on score.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL