Documentation
¶
Overview ¶
Package weight contains utilities to manage endpoint weights. Weights are used by LB policies such as ringhash to distribute load across multiple endpoints.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EndpointInfo ¶
type EndpointInfo struct {
Weight uint32
}
EndpointInfo will be stored in the Attributes field of Endpoints in order to use the ringhash balancer.
func 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.
func (EndpointInfo) Equal ¶
func (a EndpointInfo) Equal(o any) bool
Equal allows the values to be compared by Attributes.Equal.
func (EndpointInfo) String ¶
func (a EndpointInfo) String() string
String returns a human-readable representation of EndpointInfo. This method is intended for logging, testing, and debugging purposes only. Do not rely on the output format, as it is not guaranteed to remain stable.