balancer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2018 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balancer

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

func NewBalancer

func NewBalancer(httpListenCfg string, httpsListenCfg string) *Balancer

func (*Balancer) HandleClientConnect

func (b *Balancer) HandleClientConnect(ctx *core.Context)

func (*Balancer) HandleClientDisconnect

func (b *Balancer) HandleClientDisconnect(client net.Conn)

func (*Balancer) ListenHttp

func (b *Balancer) ListenHttp() (err error)

func (*Balancer) ListenHttps

func (b *Balancer) ListenHttps() (err error)

func (*Balancer) Start

func (b *Balancer) Start() error

func (*Balancer) Stop

func (b *Balancer) Stop()

type BalancerConfig

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

type ElectRequest

type ElectRequest struct {
	Context  core.Context
	Response chan core.RouterHost
	Err      chan error
}

type SafeClusters

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

type Scheduler

type Scheduler struct {
	StatsHandler *stats.StatsHandler

	ResetStats chan bool
	// contains filtered or unexported fields
}

Scheduler handles: - The overall state (clusters, router hosts) - Health-Check-Results - Election of target router hosts

func NewScheduler

func NewScheduler() *Scheduler

func (*Scheduler) AddOrUpdateCluster

func (s *Scheduler) AddOrUpdateCluster(clusterKey string, data core.ClusterUpdate)

func (*Scheduler) ElectRouterHostRequest

func (s *Scheduler) ElectRouterHostRequest(ctx core.Context) (*core.RouterHost, error)

func (*Scheduler) Start

func (s *Scheduler) Start()

func (*Scheduler) Stop

func (s *Scheduler) Stop()

func (*Scheduler) UpdateRouterStats

func (s *Scheduler) UpdateRouterStats(clusterKey string, routerHostKey string, action StatsOperationAction)

type StatsOperationAction

type StatsOperationAction int
const (
	IncrementConnection StatsOperationAction = iota
	DecrementConnection
	IncrementRefused
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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