grpcgoogle.golang.org/grpc/balancer/weightedroundrobin Index | Files | Directories

package weightedroundrobin

import "google.golang.org/grpc/balancer/weightedroundrobin"

Package weightedroundrobin provides an implementation of the weighted round robin LB policy, as defined in gRFC A58.

Experimental

Notice: This package is EXPERIMENTAL and may be changed or removed in a later release.

Index

Constants

const Name = "weighted_round_robin"

Name is the name of the weighted round robin balancer.

Functions

func SetAddrInfo

func SetAddrInfo(addr resolver.Address, addrInfo AddrInfo) resolver.Address

SetAddrInfo returns a copy of addr in which the BalancerAttributes field is updated with addrInfo.

func SetAddrInfoInEndpoint

func SetAddrInfoInEndpoint(endpoint resolver.Endpoint, addrInfo AddrInfo) resolver.Endpoint

SetAddrInfoInEndpoint returns a copy of endpoint in which the Attributes field is updated with addrInfo.

Types

type AddrInfo

type AddrInfo struct {
	Weight uint32
}

AddrInfo will be stored in the BalancerAttributes field of Address in order to use weighted roundrobin balancer.

func GetAddrInfo

func GetAddrInfo(addr resolver.Address) AddrInfo

GetAddrInfo returns the AddrInfo stored in the BalancerAttributes field of addr.

func (AddrInfo) Equal

func (a AddrInfo) Equal(o any) bool

Equal allows the values to be compared by Attributes.Equal.

func (AddrInfo) String

func (a AddrInfo) String() string

Source Files

balancer.go config.go logging.go scheduler.go weightedroundrobin.go

Directories

PathSynopsis
balancer/weightedroundrobin/internalPackage internal allows for easier testing of the weightedroundrobin package.
Version
v1.70.0 (latest)
Published
Jan 23, 2025
Platform
linux/amd64
Imports
23 packages
Last checked
17 hours ago

Tools for package owners.