Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

weight

v1.85.0
google.golang.org/grpc/experimental/balancer/weight

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

7 matches

Top ↑

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.

Dependency graph