revProxy

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SaneProxy

type SaneProxy struct {
	MaxReqPerSec uint64
	MaxErrPerSec uint64

	BackendHostMap    map[string]string
	BackendsReqPerSec map[string]uint64
	BackendsErrPerSec map[string]uint64
	BackendsBan       map[string]bool
}

SaneProxy implements RoundTrip for ReverseProxy to manage

  • RateLimiting and CircuitBreaking

func NewSaneProxy

func NewSaneProxy(maxReq uint64, maxErr uint64,
	proxyMap map[string]string, lbSeparator string) *SaneProxy

NewSaneProxy returns properly configured SaneProxy

  • RateLimiting and CircuitBreaking

func (*SaneProxy) Banned

func (sp *SaneProxy) Banned(backend string) bool

Banned returns boolean for host string as being banned for request or not

func (*SaneProxy) RoundTrip

func (sp *SaneProxy) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip implements Transport layer handler for response

  • managing rate-limiting and circuit-breaking.

Jump to

Keyboard shortcuts

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