...

Package weightedtarget

import "google.golang.org/grpc/balancer/weightedtarget"
Overview
Index
Subdirectories

Overview ▾

Package weightedtarget implements the weighted_target balancer.

All APIs in this package are experimental.

Constants

Name is the name of the weighted_target balancer.

const Name = "weighted_target_experimental"

Variables

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

var NewRandomWRR = wrr.NewRandom

type LBConfig

LBConfig is the balancer config for weighted_target.

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

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

type Target

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

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"`
}

Subdirectories

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