loadbalancer

package
v0.0.0-...-b88123c Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: Unlicense Imports: 18 Imported by: 0

Documentation

Overview

Package loadbalancer provides the internet-facing load balancer that is used to interact with applications.

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxHostAssignments = 10
)

Functions

This section is empty.

Types

type LB

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

func NewLB

func NewLB(opts ...Option) *LB

func (*LB) Handler

func (lb *LB) Handler(name string, useLatestHost bool, rw http.ResponseWriter, r *http.Request)

func (*LB) NewHostAssignments

func (lb *LB) NewHostAssignments(assignments map[string][]slicer.Range) error

func (*LB) PrivateServerAddr

func (lb *LB) PrivateServerAddr() string

PrivateServerAddr returns the address of the running server. Will panic if the server hasn't been started yet.

func (*LB) PublicServerAddr

func (lb *LB) PublicServerAddr() string

PublicServerAddr returns the address of the running server. Will panic if the server hasn't been started yet.

func (*LB) Start

func (lb *LB) Start(ctx context.Context, publicAddr, privateAddr string) (err error)

Start the server and listen at the provided address.

func (*LB) Wait

func (lb *LB) Wait() error

Wait until the server has stopped, returning any errors.

type Option

type Option func(*LB)

Jump to

Keyboard shortcuts

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