random

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 is a custom load balancer that applies filtering to available connections.

func (*Balancer) Pick

Pick selects an appropriate sub-connection using the filter logic and randomizer.

type BalancerBuilder

type BalancerBuilder struct {
	Filter loadbalance.Filter // Filter logic to be used by the Balancer instances created by this builder.
}

BalancerBuilder is a factory that creates instances of the Balancer.

func (*BalancerBuilder) Build

Build constructs a new Balancer from the information provided.

type WeightBalancer

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

WeightBalancer is a load balancer that considers the weight of each connection.

func (*WeightBalancer) Pick

Pick selects a sub-connection based on its weight.

type WeightBalancerBuilder

type WeightBalancerBuilder struct {
	Filter loadbalance.Filter
}

WeightBalancerBuilder builds a WeightBalancer.

func (*WeightBalancerBuilder) Build

Build constructs a new WeightBalancer from PickerBuildInfo.

Jump to

Keyboard shortcuts

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