weight
v1.85.0
google.golang.org/grpc/experimental/balancer/weight
Documentation
pkg.go.dev ↗Package weight contains utilities to manage endpoint weights. Weights may be used by LB policies to distribute load across multiple endpoints.
Experimental
Notice: All APIs in this package are EXPERIMENTAL and may be changed or removed in a later release.
Functions
Set
func Set(endpoint resolver.Endpoint, epInfo EndpointInfo) resolver.Endpoint
Set returns a copy of endpoint in which the Attributes field is updated with EndpointInfo.
Types
EndpointInfo
type EndpointInfo struct {
Weight uint32
}
EndpointInfo will be stored in the Attributes field of Endpoints.
FromEndpoint
func FromEndpoint(endpoint resolver.Endpoint) EndpointInfo
FromEndpoint returns the EndpointInfo stored in the Attributes field of an endpoint. It returns an empty EndpointInfo if attribute is not found.
EndpointInfo.Equal
func (a EndpointInfo) Equal(o any) bool
Equal allows the values to be compared by Attributes.Equal.