feat(ring-hash): add hash ring interface
This commit is contained in:
parent
6fdf250833
commit
b54f72c575
|
@ -0,0 +1,12 @@
|
|||
package hashring
|
||||
|
||||
type RingInterface interface {
|
||||
// 获取一个 远程连接用的目标
|
||||
GetTarget(key string) (*target, error)
|
||||
|
||||
// 获取下一个目标
|
||||
NextTarget(*target) (*target, error)
|
||||
|
||||
// 获取上一个目标
|
||||
PreTarget(*target) (*target, error)
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package hashring
|
||||
|
||||
type target struct {
|
||||
}
|
||||
|
||||
func (t *target) GetAddrString() string {
|
||||
// TODO 获取负载机器地址
|
||||
return ""
|
||||
}
|
Loading…
Reference in New Issue