Documentation ¶
Index ¶
- Constants
- func GetWeight(invoker protocol.Invoker, invocation protocol.Invocation) int64
- func NewConsistentHashLoadBalance() cluster.LoadBalance
- func NewLeastActiveLoadBalance() cluster.LoadBalance
- func NewRandomLoadBalance() cluster.LoadBalance
- func NewRoundRobinLoadBalance() cluster.LoadBalance
- type ConsistentHashLoadBalance
- type ConsistentHashSelector
- type Uint32Slice
Constants ¶
View Source
const ( // ConsistentHash ... ConsistentHash = "consistenthash" // HashNodes ... HashNodes = "hash.nodes" // HashArguments ... HashArguments = "hash.arguments" )
View Source
const ( // RoundRobin ... RoundRobin = "roundrobin" // COMPLETE ... COMPLETE = 0 // UPDATING ... UPDATING = 1 )
View Source
const (
// LeastActive ...
LeastActive = "leastactive"
)
Variables ¶
This section is empty.
Functions ¶
func GetWeight ¶
func GetWeight(invoker protocol.Invoker, invocation protocol.Invocation) int64
GetWeight ...
func NewConsistentHashLoadBalance ¶ added in v1.3.0
func NewConsistentHashLoadBalance() cluster.LoadBalance
NewConsistentHashLoadBalance ...
func NewLeastActiveLoadBalance ¶
func NewLeastActiveLoadBalance() cluster.LoadBalance
NewLeastActiveLoadBalance ...
func NewRandomLoadBalance ¶
func NewRandomLoadBalance() cluster.LoadBalance
NewRandomLoadBalance ...
func NewRoundRobinLoadBalance ¶
func NewRoundRobinLoadBalance() cluster.LoadBalance
NewRoundRobinLoadBalance ...
Types ¶
type ConsistentHashLoadBalance ¶ added in v1.3.0
type ConsistentHashLoadBalance struct { }
ConsistentHashLoadBalance ...
func (*ConsistentHashLoadBalance) Select ¶ added in v1.3.0
func (lb *ConsistentHashLoadBalance) Select(invokers []protocol.Invoker, invocation protocol.Invocation) protocol.Invoker
Select ...
type ConsistentHashSelector ¶ added in v1.3.0
type ConsistentHashSelector struct {
// contains filtered or unexported fields
}
ConsistentHashSelector ...
func (*ConsistentHashSelector) Select ¶ added in v1.3.0
func (c *ConsistentHashSelector) Select(invocation protocol.Invocation) protocol.Invoker
Select ...
type Uint32Slice ¶ added in v1.3.0
type Uint32Slice []uint32
Uint32Slice ...
func (Uint32Slice) Len ¶ added in v1.3.0
func (s Uint32Slice) Len() int
func (Uint32Slice) Less ¶ added in v1.3.0
func (s Uint32Slice) Less(i, j int) bool
func (Uint32Slice) Swap ¶ added in v1.3.0
func (s Uint32Slice) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.