balance

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNotFound     = errors.Value("key not found")
	ErrDuplicateKey = errors.Value("duplicate key detected")
	ErrEmpty        = errors.Value("empty list")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Balancer

type Balancer interface {
	Add(Key string) error
	Del(Key string) error
	Get() (string, error)
}

type RoundRobin

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

func NewRoundRobin

func NewRoundRobin() *RoundRobin

func (*RoundRobin) Add

func (rb *RoundRobin) Add(key string) error

func (*RoundRobin) Del

func (rb *RoundRobin) Del(key string) error

func (*RoundRobin) Get

func (rb *RoundRobin) Get() (string, error)

Jump to

Keyboard shortcuts

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