loadbalance

package
v0.0.0-...-fab9456 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LBRandom = iota
)

Variables

This section is empty.

Functions

func Select

func Select(nodes []string) string

func Shuffle

func Shuffle(nodes []string) []string

洗牌算法打乱数组中元素的顺序

Types

type LoadBalance

type LoadBalance interface {
	Select(nodes []string) string
}

func NewLoadBalance

func NewLoadBalance(lbType int) LoadBalance

type LoadBalanceRandom

type LoadBalanceRandom struct {
}

func (LoadBalanceRandom) Select

func (s LoadBalanceRandom) Select(nodes []string) string

Jump to

Keyboard shortcuts

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