weightedtarget

package
v1.66.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 11

Documentation

Overview

Package weightedtarget implements the weighted_target balancer.

All APIs in this package are experimental.

Index

Constants

View Source
const Name = "weighted_target_experimental"

Name is the name of the weighted_target balancer.

Variables

View Source
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

func LocalityFromResolverState added in v1.66.0

func LocalityFromResolverState(state resolver.State) string

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

Types

type LBConfig

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

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

LBConfig is the balancer config for weighted_target.

type 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.

Directories

Path Synopsis
Package weightedaggregator implements state aggregator for weighted_target balancer.
Package weightedaggregator implements state aggregator for weighted_target balancer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL