upstream

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2019 License: MIT Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnavailable = errors.New("upstream: unavailable")
)

Errors

Functions

This section is empty.

Types

type Upstream

type Upstream struct {
	Transport     http.RoundTripper
	ErrorLog      *log.Logger
	Host          string // override host
	Path          string // target prefix path
	Retries       int
	BackoffFactor time.Duration
}

Upstream controls request flow to upstream server via load balancer

func New

func New(transport http.RoundTripper) *Upstream

New creates new upstream

func SingleHost added in v0.2.0

func SingleHost(host string, transport http.RoundTripper) *Upstream

SingleHost creates new single host upstream

func (Upstream) ServeHandler

func (m Upstream) ServeHandler(h http.Handler) http.Handler

ServeHandler implements middleware interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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