Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsistentHash ¶
type ConsistentHash struct {
// contains filtered or unexported fields
}
func NewConsistentHash ¶
func NewConsistentHash(replicas int) *ConsistentHash
type RoundRobin ¶
type RoundRobin[Id comparable, T RoundRobinItem[Id]] struct { // contains filtered or unexported fields }
func NewRoundRobin ¶
func NewRoundRobin[Id comparable, T RoundRobinItem[Id]]() *RoundRobin[Id, T]
func (*RoundRobin[Id, T]) Add ¶
func (r *RoundRobin[Id, T]) Add(t T)
func (*RoundRobin[Id, T]) Next ¶
func (r *RoundRobin[Id, T]) Next() (t T)
func (*RoundRobin[Id, T]) Refresh ¶
func (r *RoundRobin[Id, T]) Refresh()
func (*RoundRobin[Id, T]) Remove ¶
func (r *RoundRobin[Id, T]) Remove(t T)
type RoundRobinItem ¶
type RoundRobinItem[Id comparable] interface { // GetId 返回唯一标识 GetId() Id }
Click to show internal directories.
Click to hide internal directories.