Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSelector ¶
func NewSelector(keys []string) selector.SelectOption
NewSelector returns a `SelectOption` that directs all request according to the given `keys`.
func ScoreNodes ¶
func ScoreNodes(keys []string, services []*registry.Service) (possibleNodes []*registry.Node, scores []uint64)
ScoreNodes returns a score for each node found in the given services.
func Strategy ¶
func Strategy(keys ...string) client.CallOption
Strategy returns a call option which tries to consistently direct all requests for a given set of keys to a single instance to improve memory efficiency where instances are caching data.
This is the preferred usage as it gives the ultimate flexibility for determining the keys used.
Usage:
`myClient.MyCall(ctx, req, shard.Strategy(req.ID))`
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.