Documentation
¶
Index ¶
- func DefaultRoute(session interfaces.ISession, msg RpcMsg, context RouteContextClass, ...)
- func RandomRoute(client RpcClient, nodeType string, msg RpcMsg, cb Callback)
- func RoundRobinRoute(client RpcClient, nodeType string, msg RpcMsg, cb Callback)
- func WeightRoundRoute(client RpcClient, nodeType string, msg RpcMsg, cb Callback)
- type Callback
- type RouteContext
- type RouteContextClass
- type RouteNodes
- type RpcClient
- type RpcClientOpts
- type RpcMsg
- type RpcNodeInfo
- type TargetRouteFunction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultRoute ¶
func DefaultRoute(session interfaces.ISession, msg RpcMsg, context RouteContextClass, cb Callback)
Calculate route info and return an appropriate node id.
func RandomRoute ¶
Random algorithm for calculating node id.
func RoundRobinRoute ¶
Types ¶
type RouteContext ¶
type RouteContext struct { }
type RouteContextClass ¶
type RouteContextClass interface {
GetNodesByType(nodeType string) RouteNodes
}
type RouteNodes ¶
type RouteNodes []RpcNodeInfo
type RpcClientOpts ¶
type RpcClientOpts struct { }
type RpcNodeInfo ¶
type TargetRouteFunction ¶
Click to show internal directories.
Click to hide internal directories.