lb

package
v0.0.0-...-7fa21a5 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BalanceTCP  = "tcp"
	BalanceHTTP = "http"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Balancer

type Balancer struct {
	// contains filtered or unexported fields
}

func Init

func Init(listenSpec string, config BalancerConfig) *Balancer

func (*Balancer) BalanceHTTP

func (b *Balancer) BalanceHTTP(ctx context.Context, notifyFunc func(error))

func (*Balancer) BalanceTCP

func (b *Balancer) BalanceTCP(ctx context.Context, notifyFunc func(error))

func (*Balancer) Shutdown

func (b *Balancer) Shutdown()

func (*Balancer) Start

func (b *Balancer) Start() error

type BalancerConfig

type BalancerConfig struct {
	Kind                     string
	Backends                 []string
	SimultaneousConnections  int
	MaxConnectionsPerAddress int
	ConnectionTimeout        time.Duration
	TLS                      *TLSBalancerConfig
}

type TLSBalancerConfig

type TLSBalancerConfig struct {
	CACertificate []byte
	Certificate   []byte
	Key           []byte
}

Jump to

Keyboard shortcuts

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