Documentation ¶
Index ¶
Constants ¶
View Source
const (
// ContextKey 这个值用来从context中获取到值
ContextKey = "Key-hash-key"
)
基于传入值的key的hash的算法: 相同的传入的key分配到相同的node上面 在使用这个算法的时候,需要在传入的context中传入需要的key
Variables ¶
View Source
var (
NoContextKeyError = errors.New("context not has key ,key str = " + ContextKey)
)
Functions ¶
func NewKeyHashBalancer ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.