handlers

package
v0.0.0-...-8f4d57c Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalancePolicy

type BalancePolicy interface {
	GetNext() *httputil.ReverseProxy
}

type Balancer

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

func NewBalancer

func NewBalancer(service config.Service, path config.Path) (*Balancer, error)

func (*Balancer) ServeHTTP

func (b *Balancer) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Files

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

func NewFiles

func NewFiles(dirPath string, basePath string) Files

func (Files) ServeHTTP

func (f Files) ServeHTTP(w http.ResponseWriter, r *http.Request)

type LeastLatencyPolicy

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

func NewLeastLatencyPolicy

func NewLeastLatencyPolicy(serversAndURLs []ServerAndWeight) *LeastLatencyPolicy

func (*LeastLatencyPolicy) GetNext

func (llp *LeastLatencyPolicy) GetNext() *httputil.ReverseProxy

type Proxy

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

func NewProxy

func NewProxy(service config.Service, path config.Path) (Proxy, error)

func (Proxy) ServeHTTP

func (p Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RandomPolicy

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

func NewRandomPolicy

func NewRandomPolicy(servers []ServerAndWeight) *RandomPolicy

func (*RandomPolicy) GetNext

func (rp *RandomPolicy) GetNext() *httputil.ReverseProxy

type RoundRobinPolicy

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

func NewRoundRobinPolicy

func NewRoundRobinPolicy(servers []ServerAndWeight) *RoundRobinPolicy

func (*RoundRobinPolicy) GetNext

func (rrp *RoundRobinPolicy) GetNext() *httputil.ReverseProxy

The servers provided must be provided in the same order for accurate results

type ServerAndWeight

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

Jump to

Keyboard shortcuts

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