balancer

package
v3.3.0-rc.0-grpc1.30.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Overview

Package balancer implements client balancer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterBuilder

func RegisterBuilder(cfg Config)

RegisterBuilder creates and registers a builder. Since this function calls balancer.Register, it must be invoked at initialization time.

Types

type Balancer

type Balancer interface {
	// Balancer takes input from gRPC, manages SubConns, and collects and aggregates
	// the connectivity states.
	//
	// It also generates and updates the Picker used by gRPC to pick SubConns for RPCs.
	//
	// UpdateClientConnState, ResolverError, UpdateSubConnState, and Close are
	// guaranteed to be called synchronously from the same goroutine.  There's no
	// guarantee on picker.Pick, it may be called anytime.
	balancer.Balancer

	// Picker calls "Pick" for every client request.
	picker.Picker
}

Balancer defines client balancer interface.

type Config

type Config struct {
	// Policy configures balancer policy.
	Policy picker.Policy

	// Name defines an additional name for balancer.
	// Useful for balancer testing to avoid register conflicts.
	// If empty, defaults to policy name.
	Name string

	// Logger configures balancer logging.
	// If nil, logs are discarded.
	Logger *zap.Logger

	// HealthCheck indicates whether health checking should be enabled for this specific balancer.
	HealthCheck bool
}

Config defines balancer configurations.

Directories

Path Synopsis
Package connectivity implements client connectivity operations.
Package connectivity implements client connectivity operations.
Package picker defines/implements client balancer picker policy.
Package picker defines/implements client balancer picker policy.
resolver
endpoint
Package endpoint resolves etcd entpoints using grpc targets of the form 'endpoint://<id>/<endpoint>'.
Package endpoint resolves etcd entpoints using grpc targets of the form 'endpoint://<id>/<endpoint>'.

Jump to

Keyboard shortcuts

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