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.
Click to show internal directories.
Click to hide internal directories.