round_robin

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balancer

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

Balancer manages load balancing over a set of connections with filtering capabilities.

func (*Balancer) Pick

Pick selects the next subConn based on the filter criteria and using round-robin.

type Builder

type Builder struct {
	Filter loadbalance.Filter // Filter is to apply during the balancing process
}

Builder constructs a Balancer with a provided filter.

func (*Builder) Build

func (b *Builder) Build(info base.PickerBuildInfo) balancer.Picker

Build constructs an instance of Balancer from the provided PickerBuildInfo.

type WeightBalancer

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

WeightBalancer is a custom gRPC load balancer implementing the balancer.Picker interface, which uses weighted round-robin balancing strategy

func (*WeightBalancer) Pick

Pick selects an appropriate connection using the provided balancer.PickInfo.

type WeightBalancerBuilder

type WeightBalancerBuilder struct {
	Filter loadbalance.Filter
}

WeightBalancerBuilder is a utility to build the WeightBalancer with a given Filter.

func (*WeightBalancerBuilder) Build

Build creates a WeightBalancer instance.

Jump to

Keyboard shortcuts

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