Versions in this module Expand all Collapse all v0 v0.2.0 Oct 30, 2024 v0.1.0 Apr 2, 2024 Changes in this version + const ConsistentHash + const DefaultConsistentHashKey + const DefaultReplicas + const LeastConnection + const Random + const RoundRobin + const Salt + const WeightKey + var ErrNoContextAvailable = errors.New("no context is available") + var ErrNoSubConnAvailable = errors.New("no SubConn is available") + func DefaultHash(data []byte) uint32 + func GetWeight(addr Address) int + func Register(b PickerBuilder) + type Address struct + Addr string + Attributes *attributes.Attributes + Name string + type DoneInfo struct + Err error + type HashFunc func(data []byte) uint32 + type Ketama struct + func NewKetama(replicas int, fn HashFunc) *Ketama + func (h *Ketama) Add(nodes ...string) + func (h *Ketama) Get(key string) (string, bool) + func (h *Ketama) IsEmpty() bool + func (h *Ketama) Remove(nodes ...string) + type PickInfo struct + Ctx context.Context + Name string + type PickResult struct + Done func(DoneInfo) + Node any + type Picker interface + Pick func(info PickInfo) (PickResult, error) + func NewErrPicker(err error) Picker + type PickerBuildInfo struct + ReadySCs map[any]SubConnInfo + type PickerBuilder interface + Build func(info PickerBuildInfo) Picker + Name func() string + func Builder(name string) PickerBuilder + type SubConnInfo struct + Address Address