weightedroundrobin
v1.51.4
github.com/lfch/grpc/balancer/weightedroundrobin
Documentation
pkg.go.dev ↗Package weightedroundrobin defines a weighted roundrobin balancer.
Constants
Name
const Name = "weighted_round_robin"
Name is the name of weighted_round_robin balancer.
Functions
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.
Experimental
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
Types
AddrInfo
type AddrInfo struct {
Weight uint32
}
AddrInfo will be stored in the BalancerAttributes field of Address in order to use weighted roundrobin balancer.
GetAddrInfo
func GetAddrInfo(addr resolver.Address) AddrInfo
GetAddrInfo returns the AddrInfo stored in the BalancerAttributes field of addr.
Experimental
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
AddrInfo.Equal
func (a AddrInfo) Equal(o interface{}) bool
Equal allows the values to be compared by Attributes.Equal.