weightroundrobin

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 4 Imported by: 3

Documentation

Overview

Package weightroundrobin provides weight round robin utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server records the node status.

type WeightRoundRobin

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

WeightRoundRobin is a smooth weighted roundrobin algorithm.

func NewWeightRoundRobin

func NewWeightRoundRobin(interval time.Duration) *WeightRoundRobin

NewWeightRoundRobin creates a new WeightRoundRobin.

func (*WeightRoundRobin) Select

func (wrr *WeightRoundRobin) Select(serviceName string, list []*registry.Node,
	opt ...loadbalance.Option) (*registry.Node, error)

Select implements loadbalance.LoadBalancer.

Jump to

Keyboard shortcuts

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