clb

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientLoadBalancer

type ClientLoadBalancer struct {
	ServiceDiscoveryClient srd.ServiceDiscoveryClient

	Mtx            sync.RWMutex
	ServiceNavs    map[string]*ServiceNavigation
	UpdateInterval time.Duration
}

func NewClientLoadBalancer

func NewClientLoadBalancer(serviceDiscoveryClient srd.ServiceDiscoveryClient, interval time.Duration) *ClientLoadBalancer

func (*ClientLoadBalancer) GetService

func (this *ClientLoadBalancer) GetService(service string) (string, error)

type ServiceNavigation

type ServiceNavigation struct {
	ServiceDiscoveryClient srd.ServiceDiscoveryClient

	ServiceName string
	Services    []*srd.ServiceEntry
	RollIndex   uint32
	Mtx         sync.RWMutex
}

func NewServiceNavigation

func NewServiceNavigation(serviceDiscoveryClient srd.ServiceDiscoveryClient, serviceName string, interval time.Duration) (*ServiceNavigation, error)

func (*ServiceNavigation) GetService

func (this *ServiceNavigation) GetService() string

func (*ServiceNavigation) UpdateServices

func (this *ServiceNavigation) UpdateServices() error

Jump to

Keyboard shortcuts

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