Search and commands

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

Type to search packages.

weightedtarget

v1.85.0
google.golang.org/grpc/balancer/weightedtarget

Documentation

pkg.go.dev ↗

Table of contents

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

9 matches

Top ↑

Package weightedtarget implements the weighted_target balancer.

All APIs in this package are experimental.

Constants

Name

const Name = "weighted_target_experimental"

Name is the name of the weighted_target balancer.

Variables

NewRandomWRR

var NewRandomWRR = wrr.NewRandom

NewRandomWRR is the WRR constructor used to pick sub-pickers from sub-balancers. It's to be modified in tests.

Functions

LocalityFromResolverState

func LocalityFromResolverState(state resolver.State) string

LocalityFromResolverState returns the locality from the resolver.State provided, or an empty string if not present.

Types

LBConfig

type LBConfig struct {
	serviceconfig.LoadBalancingConfig `json:"-"`

	Targets map[string]Target `json:"targets,omitempty"`
}

LBConfig is the balancer config for weighted_target.

Target

type Target struct {
	// Weight is the weight of the child policy.
	Weight uint32 `json:"weight,omitempty"`
	// ChildPolicy is the child policy and it's config.
	ChildPolicy *internalserviceconfig.BalancerConfig `json:"childPolicy,omitempty"`
}

Target represents one target with the weight and the child policy.

Dependency graph