loadbalancer

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoadBalancer added in v1.7.0

type LoadBalancer struct {
	Services    map[string]*ServicePool
	ServicesMux sync.RWMutex
}

func (*LoadBalancer) Register added in v1.7.1

func (loadbalancer *LoadBalancer) Register(service *Service)

type Service

type Service struct {
	Name  string
	URL   *url.URL
	At    time.Time
	Alive bool
	// contains filtered or unexported fields
}

func (*Service) IsAlive

func (service *Service) IsAlive() (alive bool)

func (*Service) IsEqualTo added in v1.9.1

func (service *Service) IsEqualTo(otherService *Service) (alive bool)

func (*Service) IsStale added in v1.9.1

func (service *Service) IsStale() (alive bool)

func (*Service) SeenAt

func (service *Service) SeenAt() (at time.Time)

func (*Service) WasSeen

func (service *Service) WasSeen(at time.Time)

type ServicePool

type ServicePool struct {
	Services []*Service
	Current  uint64
	// contains filtered or unexported fields
}

func (*ServicePool) FirstKnownInstance added in v1.7.0

func (servicePool *ServicePool) FirstKnownInstance(service *Service) (bool, int)

func (*ServicePool) GetNextService added in v1.7.0

func (servicePool *ServicePool) GetNextService() *Service

Loop over entire backends to find out an Alive and active backend service

func (*ServicePool) UpdateService

func (servicePool *ServicePool) UpdateService(service *Service)

Jump to

Keyboard shortcuts

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