balancer

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BalancerName is the name of consistent-hashring balancer.
	BalancerName = "consistent-hashring"

	// BalancerServiceConfig is a service config that sets the default balancer
	// to the consistent-hashring balancer
	BalancerServiceConfig = `{"loadBalancingPolicy":"consistent-hashring"}`

	// CtxKey is the key for the grpc request's context.Context which points to
	// the key to hash for the request. The value it points to must be []byte
	CtxKey ctxKey = "requestKey"
)

Variables

This section is empty.

Functions

func NewConsistentHashringBuilder

func NewConsistentHashringBuilder(hasher consistent.HasherFunc, replicationFactor uint16, spread uint8) balancer.Builder

NewConsistentHashringBuilder creates a new balancer.Builder that will create a consistent hashring balancer with the given config. Before making a connection, register it with grpc with: `balancer.Register(consistent.NewConsistentHashringBuilder(hasher, factor, spread))`

Types

This section is empty.

Jump to

Keyboard shortcuts

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