loadbalancer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRoundRobin

func NewRoundRobin(targets []*Target) http.RoundTripper

NewRoundRobin creates new round-robin load balancer

Types

type RoundRobin

type RoundRobin struct {
	Targets []*Target
	// contains filtered or unexported fields
}

RoundRobin strategy

func (*RoundRobin) RoundTrip

func (l *RoundRobin) RoundTrip(r *http.Request) (*http.Response, error)

type Target

type Target struct {
	Host      string
	Transport http.RoundTripper
}

Target is the load balancer target

Jump to

Keyboard shortcuts

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