modules

package
v0.0.0-...-6fc17c5 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2017 License: BSD-3-Clause Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	config.BackendConfig
	BackendControl
	sync.RWMutex
	Close chan bool
}

func NewBackend

func NewBackend(backendConfig config.BackendConfig) *Backend

type BackendControl

type BackendControl struct {
	Failed        bool
	Active        bool
	InactiveTries int
	ActiveTries   int
	Score         int
}

type BackendList

type BackendList []*Backend

type Frontend

type Frontend struct {
	config.FrontendConfig
	BackendList
	sync.RWMutex
	Close chan bool
	Pos   int
}

func NewFrontend

func NewFrontend(frontendConfig config.FrontendConfig) *Frontend

func (*Frontend) Address

func (f *Frontend) Address() string

type FrontendList

type FrontendList []*Frontend

type SLBRequest

type SLBRequest struct {
	Header   http.Header
	Status   int
	Body     []byte
	Upgraded bool
	Backend  *Backend
}

func NewWorkerRequest

func NewWorkerRequest(status int, header http.Header, body []byte) SLBRequest

func NewWorkerRequestErr

func NewWorkerRequestErr(status int, body []byte) SLBRequest

func NewWorkerRequestUpgraded

func NewWorkerRequestUpgraded() SLBRequest

func (*SLBRequest) HijackWebSocket

func (s *SLBRequest) HijackWebSocket(w http.ResponseWriter, r *http.Request)

type SLBRequestChan

type SLBRequestChan chan SLBRequest

type Worker

type Worker struct {
	Idle bool
	sync.RWMutex
}

func NewWorker

func NewWorker() *Worker

func (*Worker) Run

func (w *Worker) Run(r *http.Request, frontend *Frontend) SLBRequestChan

type WorkerPool

type WorkerPool struct {
	config.Configuration
	Workers
	sync.RWMutex
}

func NewWorkerPool

func NewWorkerPool(configuration config.Configuration) *WorkerPool

func (*WorkerPool) CountIdle

func (wp *WorkerPool) CountIdle() int

func (*WorkerPool) Get

func (wp *WorkerPool) Get(r *http.Request, frontend *Frontend) SLBRequestChan

func (*WorkerPool) Resize

func (wp *WorkerPool) Resize()

todo experiment feature

type Workers

type Workers []*Worker

Jump to

Keyboard shortcuts

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