Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultReplicas 默认的虚拟节点数 DefaultReplicas = 100 // MaxWeight 最大节点权重 MaxWeight = DefaultReplicas )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ketama ¶
type Ketama struct {
// contains filtered or unexported fields
}
Ketama 基于 Ketama 算法的一致性 hash 负载均衡器
func (*Ketama) AddWithReplicas ¶
AddWithReplicas 添加带虚拟节点的节点
func (*Ketama) AddWithWeight ¶
AddWithWeight 添加带权重的节点,权重值范围在 [1-100] 中
Click to show internal directories.
Click to hide internal directories.