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
- func SetAddrInfo(addr resolver.Address, addrInfo AddrInfo) resolver.Address
- func SetAddrInfoInEndpoint(endpoint resolver.Endpoint, addrInfo AddrInfo) resolver.Endpoint
- type AddrInfo
Constants ¶
const Name = "weighted_round_robin"
Name is the name of the weighted round robin balancer.
Functions ¶
func SetAddrInfo ¶
SetAddrInfo returns a copy of addr in which the BalancerAttributes field is updated with addrInfo.
func SetAddrInfoInEndpoint ¶
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 ¶
GetAddrInfo returns the AddrInfo stored in the BalancerAttributes field of addr.
func (AddrInfo) Equal ¶
Equal allows the values to be compared by Attributes.Equal.
func (AddrInfo) String ¶
Source Files ¶
balancer.go config.go logging.go scheduler.go weightedroundrobin.go
Directories ¶
Path | Synopsis |
---|---|
balancer/weightedroundrobin/internal | Package 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.