tunnel

package
v0.6.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balancer

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

Balancer is a 'load balancer' for a list of UUIDs each time 'Next' is called, a round-robin UUID from the list is returned, the order is gobal and concurrency safe

func NewBalancer

func NewBalancer() *Balancer

NewBalancer creates a new Balancer

func (*Balancer) Add

func (b *Balancer) Add(uuid string)

Add adds a UUID to the list

func (*Balancer) Next

func (b *Balancer) Next() string

Next returns the next round-robin UUID from the list

func (*Balancer) Remove

func (b *Balancer) Remove(uuid string)

Remove removes a UUID from the list if it exists it re-creates the UUID list from scratch with a fresh array

Jump to

Keyboard shortcuts

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