...

Package weightedroundrobin

import "google.golang.org/grpc/balancer/weightedroundrobin"
Overview
Index
Subdirectories

Overview ▾

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.

Constants

Name is the name of the weighted round robin balancer.

const Name = "weighted_round_robin"

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.

type AddrInfo

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

type AddrInfo struct {
    Weight uint32
}

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

Subdirectories

Name Synopsis
..