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
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
ServiceConfigForBalancerName provides the gRPC service configuration string for a hashring balancer with a specific replication factor by its name
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.