package routing

Import Path
	github.com/redis/go-redis/v9/internal/routing (on go.dev)

Dependency Relation
	imports 9 packages, and imported by one package


Package-Level Type Names (total 19)
/* sort by: | */
AggLogicalAndAggregator performs logical AND on boolean values. (*AggLogicalAndAggregator) Add(result interface{}, err error) error (*AggLogicalAndAggregator) AddWithKey(key string, result interface{}, err error) error (*AggLogicalAndAggregator) BatchAdd(results map[string]AggregatorResErr) error (*AggLogicalAndAggregator) BatchSlice(results []AggregatorResErr) error (*AggLogicalAndAggregator) Result() (interface{}, error) *AggLogicalAndAggregator : ResponseAggregator
AggLogicalOrAggregator performs logical OR on boolean values. (*AggLogicalOrAggregator) Add(result interface{}, err error) error (*AggLogicalOrAggregator) AddWithKey(key string, result interface{}, err error) error (*AggLogicalOrAggregator) BatchAdd(results map[string]AggregatorResErr) error (*AggLogicalOrAggregator) BatchSlice(results []AggregatorResErr) error (*AggLogicalOrAggregator) Result() (interface{}, error) *AggLogicalOrAggregator : ResponseAggregator
AggMaxAggregator returns the maximum numeric value from all shards. (*AggMaxAggregator) Add(result interface{}, err error) error (*AggMaxAggregator) AddWithKey(key string, result interface{}, err error) error (*AggMaxAggregator) BatchAdd(results map[string]AggregatorResErr) error (*AggMaxAggregator) BatchSlice(results []AggregatorResErr) error (*AggMaxAggregator) Result() (interface{}, error) *AggMaxAggregator : ResponseAggregator
AggMinAggregator returns the minimum numeric value from all shards. (*AggMinAggregator) Add(result interface{}, err error) error (*AggMinAggregator) AddWithKey(key string, result interface{}, err error) error (*AggMinAggregator) BatchAdd(results map[string]AggregatorResErr) error (*AggMinAggregator) BatchSlice(results []AggregatorResErr) error (*AggMinAggregator) Result() (interface{}, error) *AggMinAggregator : ResponseAggregator
Err error Result interface{} func (*AggLogicalAndAggregator).BatchAdd(results map[string]AggregatorResErr) error func (*AggLogicalAndAggregator).BatchSlice(results []AggregatorResErr) error func (*AggLogicalOrAggregator).BatchAdd(results map[string]AggregatorResErr) error func (*AggLogicalOrAggregator).BatchSlice(results []AggregatorResErr) error func (*AggMaxAggregator).BatchAdd(results map[string]AggregatorResErr) error func (*AggMaxAggregator).BatchSlice(results []AggregatorResErr) error func (*AggMinAggregator).BatchAdd(results map[string]AggregatorResErr) error func (*AggMinAggregator).BatchSlice(results []AggregatorResErr) error func (*AggSumAggregator).BatchAdd(results map[string]AggregatorResErr) error func (*AggSumAggregator).BatchSlice(results []AggregatorResErr) error func (*AllSucceededAggregator).BatchAdd(results map[string]AggregatorResErr) error func (*AllSucceededAggregator).BatchSlice(results []AggregatorResErr) error func (*DefaultKeyedAggregator).BatchAdd(results map[string]AggregatorResErr) error func (*DefaultKeyedAggregator).BatchAddWithKeyOrder(results map[string]AggregatorResErr, keyOrder []string) error func (*DefaultKeyedAggregator).BatchSlice(results []AggregatorResErr) error func (*DefaultKeylessAggregator).BatchAdd(results map[string]AggregatorResErr) error func (*DefaultKeylessAggregator).BatchSlice(results []AggregatorResErr) error func (*OneSucceededAggregator).BatchAdd(results map[string]AggregatorResErr) error func (*OneSucceededAggregator).BatchSlice(results []AggregatorResErr) error func ResponseAggregator.BatchAdd(map[string]AggregatorResErr) error func ResponseAggregator.BatchSlice([]AggregatorResErr) error func (*SpecialAggregator).BatchAdd(results map[string]AggregatorResErr) error func (*SpecialAggregator).BatchSlice(results []AggregatorResErr) error
AggSumAggregator sums numeric replies from all shards. (*AggSumAggregator) Add(result interface{}, err error) error (*AggSumAggregator) AddWithKey(key string, result interface{}, err error) error (*AggSumAggregator) BatchAdd(results map[string]AggregatorResErr) error (*AggSumAggregator) BatchSlice(results []AggregatorResErr) error (*AggSumAggregator) Result() (interface{}, error) *AggSumAggregator : ResponseAggregator
AllSucceededAggregator returns one non-error reply if every shard succeeded, propagates the first error otherwise. (*AllSucceededAggregator) Add(result interface{}, err error) error (*AllSucceededAggregator) AddWithKey(key string, result interface{}, err error) error (*AllSucceededAggregator) BatchAdd(results map[string]AggregatorResErr) error (*AllSucceededAggregator) BatchSlice(results []AggregatorResErr) error (*AllSucceededAggregator) Result() (interface{}, error) *AllSucceededAggregator : ResponseAggregator
Request RequestPolicy Response ResponsePolicy Tips that are not request_policy or response_policy e.g nondeterministic_output, nondeterministic_output_order. (*CommandPolicy) CanBeUsedInPipeline() bool (*CommandPolicy) IsReadOnly() bool
DefaultKeyedAggregator reassembles replies in the exact key order of the original request. (*DefaultKeyedAggregator) Add(result interface{}, err error) error (*DefaultKeyedAggregator) AddWithKey(key string, result interface{}, err error) error (*DefaultKeyedAggregator) BatchAdd(results map[string]AggregatorResErr) error (*DefaultKeyedAggregator) BatchAddWithKeyOrder(results map[string]AggregatorResErr, keyOrder []string) error (*DefaultKeyedAggregator) BatchSlice(results []AggregatorResErr) error (*DefaultKeyedAggregator) Result() (interface{}, error) (*DefaultKeyedAggregator) SetKeyOrder(keyOrder []string) *DefaultKeyedAggregator : ResponseAggregator func NewDefaultKeyedAggregator(keyOrder []string) *DefaultKeyedAggregator
DefaultKeylessAggregator collects all results in an array, order doesn't matter. (*DefaultKeylessAggregator) Add(result interface{}, err error) error (*DefaultKeylessAggregator) AddWithKey(key string, result interface{}, err error) error (*DefaultKeylessAggregator) BatchAdd(results map[string]AggregatorResErr) error (*DefaultKeylessAggregator) BatchSlice(results []AggregatorResErr) error (*DefaultKeylessAggregator) Result() (interface{}, error) *DefaultKeylessAggregator : ResponseAggregator
OneSucceededAggregator returns the first non-error reply, if all shards errored, returns any one of those errors. (*OneSucceededAggregator) Add(result interface{}, err error) error (*OneSucceededAggregator) AddWithKey(key string, result interface{}, err error) error (*OneSucceededAggregator) BatchAdd(results map[string]AggregatorResErr) error (*OneSucceededAggregator) BatchSlice(results []AggregatorResErr) error (*OneSucceededAggregator) Result() (interface{}, error) *OneSucceededAggregator : ResponseAggregator
( RandomPicker) Next(total int) int RandomPicker : ShardPicker
( RequestPolicy) String() string RequestPolicy : github.com/pancsta/asyncmachine-go/internal/nofmt.Stringer RequestPolicy : github.com/pandatix/go-abnf.ElemItf RequestPolicy : expvar.Var RequestPolicy : fmt.Stringer func ParseRequestPolicy(raw string) (RequestPolicy, error) const ReqAllNodes const ReqAllShards const ReqDefault const ReqMultiShard const ReqSpecial
ResponseAggregator defines the interface for aggregating responses from multiple shards. Add processes a single shard response. AddWithKey processes a single shard response for a specific key (used by keyed aggregators). ( ResponseAggregator) BatchAdd(map[string]AggregatorResErr) error ( ResponseAggregator) BatchSlice([]AggregatorResErr) error Result returns the final aggregated result and any error. *AggLogicalAndAggregator *AggLogicalOrAggregator *AggMaxAggregator *AggMinAggregator *AggSumAggregator *AllSucceededAggregator *DefaultKeyedAggregator *DefaultKeylessAggregator *OneSucceededAggregator *SpecialAggregator func NewDefaultAggregator(isKeyed bool) ResponseAggregator func NewResponseAggregator(policy ResponsePolicy, cmdName string) ResponseAggregator
( ResponsePolicy) String() string ResponsePolicy : github.com/pancsta/asyncmachine-go/internal/nofmt.Stringer ResponsePolicy : github.com/pandatix/go-abnf.ElemItf ResponsePolicy : expvar.Var ResponsePolicy : fmt.Stringer func ParseResponsePolicy(raw string) (ResponsePolicy, error) func NewResponseAggregator(policy ResponsePolicy, cmdName string) ResponseAggregator const RespAggLogicalAnd const RespAggLogicalOr const RespAggMax const RespAggMin const RespAggSum const RespAllSucceeded const RespDefaultHashSlot const RespDefaultKeyless const RespOneSucceeded const RespSpecial
(*RoundRobinPicker) Next(total int) int *RoundRobinPicker : ShardPicker
ShardPicker chooses “one arbitrary shard” when the request_policy is ReqDefault and the command has no keys. // returns an index in [0,total) RandomPicker *RoundRobinPicker *StaticShardPicker
SpecialAggregator provides a registry for command-specific aggregation logic. (*SpecialAggregator) Add(result interface{}, err error) error (*SpecialAggregator) AddWithKey(key string, result interface{}, err error) error (*SpecialAggregator) BatchAdd(results map[string]AggregatorResErr) error (*SpecialAggregator) BatchSlice(results []AggregatorResErr) error (*SpecialAggregator) Result() (interface{}, error) *SpecialAggregator : ResponseAggregator func NewSpecialAggregator(cmdName string) *SpecialAggregator
StaticShardPicker always returns the same shard index. (*StaticShardPicker) Next(total int) int *StaticShardPicker : ShardPicker func NewStaticShardPicker(index int) *StaticShardPicker
Package-Level Functions (total 8)
NewResponseAggregator creates an aggregator based on the response policy.
NewSpecialAggregator creates a special aggregator with command-specific logic if available.
RegisterSpecialAggregator registers a custom aggregation function for a command.
Package-Level Variables (total 5)
SpecialAggregatorRegistry holds custom aggregation functions for specific commands.