balancer

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// 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 NameForReplicationFactor added in v1.18.1

func NameForReplicationFactor(replicationFactor uint16) string

NameForReplicationFactor returns the name of the balancer for a given replication factor

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))`

func ServiceConfigForBalancerName added in v1.18.1

func ServiceConfigForBalancerName(balancerName string) string

ServiceConfigForBalancerName provides the gRPC service configuration string for a hashring balancer with a specific replication factor by its name

Types

This section is empty.

Jump to

Keyboard shortcuts

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