wrr

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MPL-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is wrr balancer name
	Name = "wrr"
)

Variables

This section is empty.

Functions

func New

func New(opts ...Option) selector2.Selector

New random a selector.

func NewBuilder

func NewBuilder(opts ...Option) selector2.Builder

NewBuilder returns a selector builder with wrr balancer

Types

type Balancer

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

Balancer is a random balancer.

func (*Balancer) Pick

Pick is pick a weighted node.

type Builder

type Builder struct{}

Builder is wrr builder

func (*Builder) Build

func (b *Builder) Build() selector2.Balancer

Build creates Balancer

type Option

type Option func(o *options)

Option is random builder option.

Jump to

Keyboard shortcuts

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