random

package
v2.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func New

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

New a random selector.

func NewBuilder added in v2.1.1

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

NewBuilder returns a selector builder with random balancer

Types

type Balancer

type Balancer struct{}

Balancer is a random balancer.

func (*Balancer) Pick

Pick is pick a weighted node.

type Builder added in v2.1.1

type Builder struct{}

Builder is random builder

func (*Builder) Build added in v2.1.1

func (b *Builder) Build() selector.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